Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2020
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.40 KB | None | 0 0
  1. package A;
  2.  
  3. use B;
  4. use С;
  5.  
  6. sub new
  7. {
  8.     my $class = shift;
  9.     my $opt = shift;
  10.        
  11.     my $self = {
  12.         connect1 => DB->connect(1),
  13.         connect2 => DB->connect(2),
  14.         connect3 => DB->connect(3),
  15.     };
  16.    
  17.     $self->{opt} = $opt;
  18.     bless $self, $class;
  19. }
  20.  
  21. sub start
  22. {
  23.     my $self = shift;
  24.    
  25.     if($self->{opt}->{B})
  26.     {
  27.         B->new($self)->start;
  28.     }
  29.     if($self->{opt}->{C})
  30.     {
  31.         C->new($self)->start;
  32.     }
  33. }
  34.  
  35. 1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement