[EMAIL PROTECTED] writes:
> Eew. That looks like a bug in perl somewhere.
> 
>     shuffle 1 .. 10;                         # Fine.
>     shuffle 1, 2, 3, 4, 5, 6, 7, 8, 9, 10;   # Not ok.

[Perl5-porters is CC'd on this.  Note to them: shuffle() does a
for/foreach loop over @_ and modifies the insides.  Followup set to
perl5-porters, but I post via NNTP and don't know if SMTP people will
see that...]

I would not be at all surprised if Perl is doing some optimization to
translate
        for(1..10) {...}
to
        for($i=1;$i<10;++$i){local($_)=$_[$i]; ... } 
or something roughly equivalent.  To reduce it even farther, one of
these works and the other doesn't - try it and see:

perl -e 'for (1..10) { $_++; }'
perl -e 'for (1,2,3,4,5,6,7,8,9,10) { $_++; }'

Is this a known bug?

--Bill.

-- 
William R Ward            [EMAIL PROTECTED]          http://www.wards.net/~bill/
-----------------------------------------------------------------------------
AMAZING BUT TRUE: There is so much sand in northern Africa that if it were
                  spread out it would completely cover the Sahara Desert!

Reply via email to