in reply to Re^3: grep command
in thread grep command

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.