in reply to Re: Global symbol requires explicit package name
in thread Global symbol requires explicit package name
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Global symbol requires explicit package name
by greengaroo (Hermit) on Nov 28, 2012 at 16:01 UTC | |
by ColonelPanic (Friar) on Nov 28, 2012 at 16:43 UTC | |
by greengaroo (Hermit) on Nov 28, 2012 at 18:34 UTC | |
by ColonelPanic (Friar) on Nov 29, 2012 at 06:28 UTC |