![]() |
|
The stupid question is the question not asked | |
PerlMonks |
Re: Returning two hashes from a sub?by BrowserUk (Patriarch) |
on Mar 01, 2004 at 22:27 UTC ( #333077=note: print w/replies, xml ) | Need Help?? |
There is a technique mentioned in perlsub for dealing with this. Although it may be seen as old-fashioned, it still works fine, and allows you to deal with "real hash" syntax inside and outside the sub without resorting to global vars or en masse copying of data.
What you do is assign the returned hashref to (localised) glob. You can then access the has via that glob name using standard hash variable syntax instead hashref syntax. It does simplify the syntax without the need to copy and avoiding the risks of global vars. Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham"Think for yourself!" - Abigail
In Section
Seekers of Perl Wisdom
|
|