Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: Perl Inheritance & module variables

by brian_d_foy (Abbot)
on Sep 20, 2008 at 19:41 UTC ( #712765=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download

  1. or download this
    package Parent;
    sub new { bless {}, $_[0]; }
    sub parent_version { $_[0]->SUPER::VERSION }
  2. or download this
    print "Parent version is ", Parent->VERSION, "\n"; # 1.23
    print "Child version is ", Child->VERSION, "\n";  # 5.43
  3. or download this
    my $child = Child->new;
    print "Child version: ",  $child->VERSION, "\n";            # 5.43
    print "Parent version: ", $child->parent_version, "\n"; # 1.23
  4. or download this
    print "Child version: ",  $child->child_version, "\n"; # 5.43
  5. or download this
    print "Child version: ",  $child->VERSION, "\n";          # 5.43
    print "Child version: ",  $child->child_version, "\n"; # 5.43

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2015-11-28 19:10 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (743 votes), past polls