If you insist on using nested subs, there are ways & means to implement them e.g. using anonymous subs e.g. (IIRC - since I've not used them since I discovered the wonders of perl)...
sub some_sub { my $var; my $nested_sub = sub { . . if ($var eq q/value/) { # Do something } else { # Do something else $var = q/some_other_val/; } }; # Do some stuff $var = q/value/; &$nested_sub(args); if ($val eq q/some_other_val/) { # Do some more stuff } else { # Do something else entirely } . }
In reply to Re^3: Variable initialization / reinitialization
by Bloodnok
in thread Variable initialization / reinitialization
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |