Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
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 surveying the Monastery: (14)
As of 2014-10-01 14:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (22 votes), past polls