GrandFather gave you an example of how to make your code work, but I think a reference is in order (no, not that kind).
Instead of my $value = 'reve*ker';, as in your original code, GrandFather changed it to my $value = qr'reve.*ker';. See that little qr in there? That's the quote regex operator. It takes a string, compiles it into a regex, and returns it for later use. To quote perlop,
This operator quotes (and possibly compiles) its STRING as a regular expression. STRING is interpolated the same way as PATTERN in m/PATTERN/. If "'" is used as the delimiter, no interpolation is done. Returns a Perl value which may be used instead of the corresponding /STRING/imosx expression.
perlop. Lots of good stuff in there.
HTH
BTW, I'd like to second GrandFather's comment about long lines. Horizontal scrolling is awkward.
In reply to Re^2: how to add more intelligence to grep functionality
by bobf
in thread how to add more intelligence to grep functionality
by jesuashok
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |