in reply to Re^2: Closure producing 'Modification of read-only value' error
in thread Closure producing 'Modification of read-only value' error

What about the implicit localizations of $_ done by map, grep, for, etc.? Do they do The Right Thing®?

I think it is surprising (hence bad) that the while ( <FH> ) idiom doesn't do an implicit localization of $_ like the looping constructs listed above. Is there a fundamental reason for this, or is it due to a severe tuit shortage?

the lowliest monk

  • Comment on Re^3: Closure producing 'Modification of read-only value' error

Replies are listed 'Best First'.
Re^4: Closure producing 'Modification of read-only value' error
by nobull (Friar) on Jun 11, 2005 at 19:09 UTC
    map, grep, for etc do the right thing.

    The magic while construct does not make $_ and alias - it assigns to it. This is fundamentally different. That said, it bugs me that it doesn't do implicit localization.