You are passing a hash reference, not a hash (which gets flattened into a list).
The first dump works as expected because it sees a list containing one element which is the reference to the hash you passed in.
The my %test = @_; and generates an error because @_ contains only one element - the reference to the hash. Instead you should my $test = shift; and work with the reference.
In reply to Re^3: Trouble passing hash into function
by GrandFather
in thread Trouble passing hash into function
by dbonneville
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |