in reply to Better way to dereference a shifted hashref arg?

You don't have to dereference the hashref if you want to use it. For example, instead of:

my %arg = %{$arg}; for (keys %arg) { ... }
you can do:
for (keys %$arg) { ... }
That's what references allow in the first place, use it. :)

As for your other question, perldoc -f ref:

die "No what I want!" unless (ref($arg) eq "HASH");