chromatic/modern_perl_book — Issue #192: 1.4.1 The Default Scalar Variable
Author: legrady
Created: 2011-11-01 16:55:38+00:00
State: open

Using $_ is wonderful in one-liners and throw-away code, because it saves typing.

In important code it causes posts on Perlmonks wondering why it doesn't work as expected with one of the commands that doesn't default to $_, or generates errors when loops are nested.

Where $_ is essential is in map and grep and with the postfix for, but page 7 is probably too early to mention those.