See Re^2: Duh. 'my' scope in if else blocks.. If you still want that, then you just put an explicit scoping block around the area where the variable is used, of course. I'd probably put the assignment outside of the conditional as well.
- tye
In reply to Re: What about if (my $var = foo()) { ... } (explicit)
by tye
in thread What about if (my $var = foo()) { ... }
by Limbic~Region
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |