in reply to
Perl GREP
Parenthesis are regex meta characters and need to be escaped. You can easily do that with the
quotemeta
function or the "\Q"
regex
sequence:
my $Check = quotemeta("1()"); if (grep /$Check/i, <FILE>) { ...
[download]
That said, I hope the file is small, because slurping the entire contents of a file into memory is usually not a good strategy.
Comment on
Re: Perl GREP
Download
Code
In Section
Seekers of Perl Wisdom