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

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

by theAcolyte (Pilgrim)
on Jul 17, 2004 at 22:22 UTC ( #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
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? | Other CB clients
Other Users?
Others pondering the Monastery: (13)
As of 2015-07-06 22:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (83 votes), past polls