I agree that the original code is not clean. However, your solution makes an unnecessary copy of the array. You could just do this
my $fh=shift; my $h=shift; foreach my $key (@_)
Though this issue disappears entirely if the sub is switched to pass by reference in order to fix the other problems.
In reply to Re^2: Global symbol requires explicit package name
by ColonelPanic
in thread Global symbol requires explicit package name
by cunningrat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |