Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Why is a hash the default "object" in oo perl?

by theAcolyte (Pilgrim)
on Jul 17, 2004 at 22:22 UTC ( [id://375293]=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    { my $age; sub age {
        my $self = shift;
        return $age unless @_;
        $age = shift;
    }}
    
  2. or download this
    { my %agedata; sub age {
       my $self = shift;
       return $age{$self} unless @_;
       $age{$self} = shift;
    }}
    
  3. or download this
    {{ my $variable } sub accessor {
          ....
    }}
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://375293]
Approved by Corion
Front-paged by grinder
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2024-04-16 12:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found