Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (9)
As of 2014-08-23 02:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (171 votes), past polls