This is probably version-dependent (which perl version you use?) and with less probablilty $^O-dependent (what is $^O in your case?)D:\Work\PerlScripts\utl>perl -MO=Deparse -we "$x=[];for(@$x){}" $x = []; foreach $_ (@$x) { (); } -e syntax OK D:\Work\PerlScripts\utl>perl -MO=Deparse -we "$x=[];for(;;){}" Name "main::x" used only once: possible typo at -e line 1. $x = []; for (;;) { (); } -e syntax OK D:\Work\PerlScripts\utl>perl -MO=Deparse -we "$x=[];for($i=0;$i<=$#x;$ +i++){}" $x = []; for ($i = 0; $i <= $#x; ++$i) { (); } -e syntax OK
I think we'll find common denominator soon.
update: after I saw your update I understood more and now I think we found that commond denominator that I've just mentioned. Thanks.
In reply to Re: Re: Is for(@$array_ref) construct optimized? YES!
by Weasel
in thread Is for(@$array_ref) construct optimized? YES!
by Weasel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |