Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

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

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

Help for this page

Select Code to Download


  1. or download this
    # A.pm
    package A;
    use 5.014;
    ...
    }
    
    1;
    
  2. or download this
    # C.pm
    package C;
    use 5.014;
    ...
        say 'Goodbye, ', $self->name, '!';
    }
    1;
    
  3. or download this
    # C1.pm
    package C1;
    use 5.014;
    ...
             );
    
    1;
    
  4. or download this
    use strict;
    use warnings;
    ...
    my $c = C1->new(name => 'John Doe');
    $c->say_hello('World');
    $c->say_goodbye;
    
  5. or download this
    package C1;
    use parent (qw(A B C D));
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-04-24 17:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found