To answer the question of why your code snippet won't work, remember that Perl flattens subroutine arguments into a single list of scalars; your code shifts the first element off that list ( a hash key in this case ) and takes a reference to it, i.e. you end up with a reference to a scalar and the remainder of your hash is thrown away.
Others have posted the correct solution.
In reply to Re: passing hashes and hash reference
by slife
in thread passing hashes and hash reference
by symŽ
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |