in reply to Re^2: syntax of map operator
in thread syntax of map operator

I guess that's more an artifact of the implementation than that it was designed to work this way.

I fully agree. Compile-time lexical scopes and run-time lexical scopes should be the same. All of these are in the same bag:

Just don't.

Replies are listed 'Best First'.
Re^4: syntax of map operator
by JavaFan (Canon) on Jan 24, 2010 at 22:48 UTC
    I'm very glad EXPR if COND doesn't provide a lexical scope. That allows me to write:
    local $dbh->{AutoCommit} = 0 if !$already_in_a_transaction;
    I once had a cow orker (who thinks he's one of the smartest programmers in the world) rewrite that as
    if (!$already_in_a_transaction) { local $dbh->{AutoCommit} = 0; }
      You should wrap one more if around that just to be sure.