in reply to Duh. 'my' scope in if else blocks.
It makes sense to me because the "my" is up outside of the curlies. This wouldn't work, for example:
Parenthencies don't influence lexical scope.if ( scalar( @_ ) ) { my $t = shift; $t =~ s/change_something/to_something_else/; } print "$t\n";
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Duh. 'my' scope in if else blocks.
by Thilosophy (Curate) on Dec 11, 2007 at 11:14 UTC | |
by ikegami (Patriarch) on Dec 11, 2007 at 19:57 UTC | |
by doom (Deacon) on Dec 11, 2007 at 19:14 UTC |