That's right, but sorry you are overcomplicating things.
Precedence isn't relevant here:
DB<1> use strict; my $N = $N; Global symbol "$N" requires explicit package
Declarations are only effective after the statement, in this case behind the semicolon.
This was done to allow accessing equally named variables from a surrounding scope.
See perlsub#Private-Variables-via-my()
The declared variable is not introduced (is not visible) until after the current statement. Thus,
my $x = $x;can be used to initialize the new $x with the value of the old $x, and the expression
my $x = 123 and $x == 123is false unless the old $x happened to have the value 123.
Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery
In reply to Re^2: Strange compile error?
by LanX
in thread Strange compile error?
by gelbukh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |