if (my $x = ...) { ... } elsif (my $x = ...) { ... }
Looking at it this way, you will notice that both $x's are actually in the same block. Hence the error.
There are no 'curlys' enclosing the seperate conditions.
So use something like Herkum's solution.
In reply to Re: strange scope
by nedals
in thread strange scope
by anagramster
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |