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:
you can do:my %arg = %{$arg}; for (keys %arg) { ... }
That's what references allow in the first place, use it. :)for (keys %$arg) { ... }
As for your other question, perldoc -f ref:
die "No what I want!" unless (ref($arg) eq "HASH");
|
|---|