in reply to grep { $var } @arr
Yes you can do that but I usually do it like this:
@res = grep (/$pat/g, @arr);
Perl 5.8.8 on Redhat Linux RHEL 5.5.56 (64-bit)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: grep { $var } @arr
by Laurent_R (Canon) on Jul 17, 2014 at 18:55 UTC | |
by AppleFritter (Vicar) on Jul 21, 2014 at 09:54 UTC | |
by Laurent_R (Canon) on Jul 21, 2014 at 17:37 UTC | |
Re^2: grep { $var } @arr
by igelkott (Priest) on Jul 21, 2014 at 07:10 UTC |
In Section
Seekers of Perl Wisdom