in reply to What about if (my $var = foo()) { ... }
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
|
|---|