Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: object oriented Perl advice / constructor creation in child class

by haj (Vicar)
on Jul 11, 2018 at 09:43 UTC ( [id://1218296]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    package C::C1; # That's the perlish name for the module
    use File::FindLib 'lib';
    ...
    }
    # etc
    # Repeat for C and D, ad libidum.
    
  2. or download this
    sub new_d {
        my $self = shift;
    ...
        }
        return $self->{_d};
    }
    
  3. or download this
    use C::C1;
    my $c1 = C::C1->new;
    $c1->a_method_1();   # will execute A::a_method_1
    $c1->b_method_1();   # will execute B::b_method_1
    $c1->new_d(@params)  # will execute $self->{_d} = D->new(@params)
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1218296]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2024-03-28 08:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found