in reply to Re^2: Trouble passing hash into function
in thread Trouble passing hash into function

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.


DWIM is Perl's answer to Gödel