good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: passing multiple hashes to a subroutineby Sewi (Friar) |
on Oct 19, 2011 at 12:32 UTC ( [id://932381]=note: print w/replies, xml ) | Need Help?? |
Hashes and arrays are the same in array context. Try print join(", ", @_);at the beginning of your sub to see the effect. I suggest passing references instead of hashes:
Always remember that you're working on your original hashes when using references: The sub will modify the original %x and $x{a} is gone away at the last line.
In Section
Seekers of Perl Wisdom
|
|