http://qs321.pair.com?node_id=384985


in reply to Playing with non-localized $_ in nested loops.

Regarding what surprised you, a comparison of the output of these two one-liners affirms your conjecture. Neither of the following warns directly about a read:

% perl -le 'warn "a"' a at -e line 1. % echo "" | perl -le '<>; warn "a"' a at -e line 1, <> line 1.
Once a <> has been invoked, warnings will include latest readline coordinates regarless of what triggers them.

By the way, this issue has bitten real live sites. I gave a lightning talk in YAPC::Israel::2004 about this.