in reply to Re: Re: Re: Re: (re:x5 use strict....)$a and $b should be in perlvar
in thread use strict won't require explicit name for all variables?
To clear up a misconception though, your "action at a distance" horror scenario there won't happen. No sir. $a and $b are (apparently) local'd to the block:
I knew this. Several others in channel this morning knew this. But in an ironic twist of events, I can't find where that localization is documented. I think I see it in the Perl source...but not in the docs.@list=qw( one two three four five ); $a="Hello"; $b="World"; sort { $a <=> $b } @list; print "$a $b"; # Hello World
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Mistaken notions of $a/$b strict
by dragonchild (Archbishop) on Feb 28, 2002 at 16:02 UTC | |
by blakem (Monsignor) on Mar 01, 2002 at 02:13 UTC | |
by dragonchild (Archbishop) on Mar 01, 2002 at 14:28 UTC |