grep evaluates an expression, unlike split which matches a pattern. Consider:
use strict; use warnings; my $re = qr/y/; $_ = 'yep'; print /y/; print "\n".$re; print "\n"./$re/;
which prints:
1 (?-xism:y) 1
In reply to Re: Grep matches all elements if compiled regex is passed as EXPR
by GrandFather
in thread Grep matches all elements if compiled regex is passed as EXPR
by isotope
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |