I don't understand why you can't pass by value, but no matter, you can just dereference inside the sub.
sub mysub{ my $h = shift; my %dereferenced_hash = %$h; delete $dereferenced_hash{'b'}; }
In reply to Re^3: Global variable unexpectedly modified when passed by reference
by Anonymous Monk
in thread Global variable unexpectedly modified when passed by reference
by fshrewsb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |