in reply to Getting pair of values from an array

%{} tries to dereference a hash ref.. which @_ certainly isn't.
my ($var, $val); for (($var, $val) = each %{{@_ }}) { print "var = $var; val = $val\n"; }
Note the double brackets; the inner pair builds an anonymous hash and returns a reference to it which the outer pair with % dereferences. However, you have a big pitfall in there in that duplicate keys will lead to loss of data - so this is not a universally useful solution. As japhy said: use splice.