in reply to Re^2: 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;

which doesn't work as they expect.

Enjoy, Have FUN! H.Merijn

Replies are listed 'Best First'.
Re^4: grep command
by blazar (Canon) on Jan 19, 2007 at 09:20 UTC
    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.