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?

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 scrutinizing the Monastery: (7)
As of 2016-09-27 09:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (500 votes). Check out past polls.