Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Perl Inheritance & module variables

by brian_d_foy (Abbot)
on Sep 20, 2008 at 19:41 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (9)
As of 2024-04-18 15:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found