Perl Monk, Perl Meditation | |
PerlMonks |
Re: grep {CONSTANT} @listby LanX (Saint) |
on Nov 21, 2012 at 20:42 UTC ( [id://1005003]=note: print w/replies, xml ) | Need Help?? |
you are confusing a regex data-type with a regex operation. grep {REGEXP} uses a code-block which returns a regex which is always true if defined. grep {/string/} uses a m// (match operation) which defaults to test $_.
Cheers Rolf
In Section
Seekers of Perl Wisdom
|
|