in reply to
Grep matches all elements if compiled regex is passed as EXPR
When you don't put the slashes on, you're just testing the variable.
$re
(having a regex value) is true.
/$re/
is a pattern match which can be true or false.
Caution:
Contents may have been coded under pressure.
Comment on
Re: Grep bug -- doesn't handle passed, precompiled regular expressions properly
Select
or
Download
Code
In Section
Seekers of Perl Wisdom