Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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: (16)
As of 2015-07-31 21:03 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 (282 votes), past polls