Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: how do I use a hash of hashes reference to a function ?

by Fastolfe (Vicar)
on Sep 22, 2000 at 02:28 UTC ( [id://33577]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub function {
       my $hashref = shift;
    ...
    my %hash = ( one => 1, two => 2 );
    &function(\%hash);
    print join(", ", keys %hash);   # one, two, three
    
  2. or download this
    sub function (%) {
       my %hashref = shift;
    ...
    }
    
    &function(%hash);       # passes %hash as a ref
    
  3. or download this
    sub function {
       my %hash = %{shift};   # de-references
    
       $hash{three} = 3;      # Does not affect the real %hash!
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2024-03-28 11:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found