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

Re: Passing a hash into a subroutine

by chimni (Pilgrim)
on Jan 08, 2004 at 08:50 UTC ( #319751=note: print w/ replies, xml ) Need Help??


in reply to Passing a hash into a subroutine


Suggest you pass a reference to a hash and iterate over the keys to extract the value.

&callsub(\%hash); sub callsub { my($ref)=@_; foreach my $key(keys %$ref){ print $ref->{$key}; } }

Also suggest you get a copy of the "Perl cookbook" .Very handy for such day to day problems
HTH.
chimni


Comment on Re: Passing a hash into a subroutine
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (11)
As of 2015-08-04 20:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (74 votes), past polls