Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: can i return two hashes from a soubroutine

by thezip (Vicar)
on Oct 25, 2007 at 20:44 UTC ( #647272=note: print w/ replies, xml ) Need Help??


in reply to can i return two hashes from a soubroutine

You'll need to return references to your hashes from the sub, as in:

return(\%test1, \%test2);

In the caller, if you must, you can dereference the hashrefs by:

my ($test1,$test2) = &testsub; my %test1 = %$test1; my %test2 = %$test2;

Where do you want *them* to go today?


Comment on Re: can i return two hashes from a soubroutine
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (13)
As of 2014-10-23 18:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (128 votes), past polls