in reply to Re^2: Scoping question
in thread Scoping question

I think your interpretation of duff's example is different than intended. Consider:
use strict; use warnings; my $item = "a"; if(1){ my $item = $item; }
This compiles fine with no errors...

Replies are listed 'Best First'.
Re^4: Scoping question
by ihb (Deacon) on Nov 04, 2004 at 13:43 UTC

    Note that you don't need to have if (1). A block is fine all by itself, and does enforce a new scope. A bare block is a loop construct though while an if block isn't, which is important to remember when you use e.g. last.

    ihb

    See perltoc if you don't know which perldoc to read!
    Read argumentation in its context!