Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

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 chanting in the Monastery: (8)
As of 2016-10-24 06:52 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (303 votes). Check out past polls.