in reply to using strict
The "my" operator declares the listed variables to be lex-
ically confined to the enclosing block, conditional
("if/unless/elsif/else"), loop ("for/fore-
ach/while/until/continue"), subroutine, "eval", or
"do/require/use"'d file.
you're doing something like
but $inner is only seen in "scope if" and "scope else". no variable $inner has ever been defined in "scope file". so just add a my $inner; before your if/else-stataments.# scope file if ($condition1) { # scope if my $inner = 1; } else { # scope else my $inner = 2; } # scope file print $inner;
|
|---|