in reply to Re: Re: Re: for ( ; ; ) vs for ( .. )
in thread for ( ; ; ) vs for ( .. )

which version of perl? I can't seem to reproduce it... Mine is 5.6.1 on a solaris

me@myhost> perl -MO=Deparse -e 'for( my $x = 0; $x < 10; $x++ ) { pr +int "foo\n" }' for (my $x = 0; $x < 10; ++$x) { print "foo\n"; } -e syntax OK me@myhost>

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: for ( ; ; ) vs for ( .. )
by Elian (Parson) on May 24, 2002 at 01:02 UTC
    5.6.0 on OS X. Same result on 5.005_03. Presumably either Deparse or the peephole optimizer were thumped in 5.6.1 giving the different result.