I think that there's no one consistent way to define one. Usually variables are block scoped, so making my $x for @list behaving the same as do { my $x } for @list is just weird.Do you really think that it's weirder than having for my $x ( @list ) { BLOCK } behave the same as { my $x; for $x ( @list ) { BLOCK } }?
In reply to Re^4: Lexical scope vs. postfix loops (perl bug?)
by JadeNB
in thread Lexical scope vs. postfix loops (perl bug?)
by jh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |