in reply to Re^2: Variable initialization / reinitialization
in thread Variable initialization / reinitialization

NP

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 } . }

A user level that continues to overstate my experience :-))