/$pat/g
Perhaps I've misunderstood but with my current $var, using /$pat/g will result in no matches (with or without the 'g' modifier). As far as I know, this will look for the literal string of '$_ < 3' on my array, as written below (appending to the initial script).
@res = grep {/$pat/g} @arr; print "Search:\t@res\n";
This finds none of the elements of @arr.
In reply to Re^2: grep { $var } @arr
by igelkott
in thread grep { $var } @arr
by igelkott
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |