I don't see it as a *simple* spoiler, as people quite often try it in scalar context like$cnt += m{pattern}g;
But then the usual workaround is
$cnt += () = m{pattern}g;
which is somewhat simpler and more natural than your reference-and-dereference trick.
In reply to Re^4: grep command
by blazar
in thread grep command
by sanku
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |