in reply to How to avoid $_ in grep
Would this work for you? Just take a reference to $_.
my @array_2 = grep {my $element = \$_; $$element =~ /foo/} @array_1;
lupey
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to avoid $_ in grep
by ikegami (Patriarch) on Nov 13, 2007 at 21:10 UTC |