matija has asked for the wisdom of the Perl Monks concerning the following question:
The thing is, I don't want references to hashes later in the program (Lazy).
So far, I could only think of doing something like:
I have considered passing the two hashes to the subroutine as parameters, and then in the subroutine assigning values to $_[0], but I would prefer not to do that because I don't find it very readable.my ($first,$second)=routine(); my %first=%{$first}; my %second=%{$second};
I've looked for inspiration in perldoc perlref, but I found none. And yet I feel that there must be a way to do it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Returning two hashes from a sub?
by Limbic~Region (Chancellor) on Mar 01, 2004 at 15:31 UTC | |
|
Re: Returning two hashes from a sub?
by esskar (Deacon) on Mar 01, 2004 at 15:53 UTC | |
|
Re: Returning two hashes from a sub?
by davido (Cardinal) on Mar 01, 2004 at 16:23 UTC | |
|
Re: Returning two hashes from a sub?
by revdiablo (Prior) on Mar 01, 2004 at 18:52 UTC | |
|
Re: Returning two hashes from a sub?
by BrowserUk (Patriarch) on Mar 01, 2004 at 22:27 UTC |