in reply to Re: Re: Re: Re: infinite loop on while (@array)
in thread infinite loop on while (@array)
From B::Deparses documentation <super>(Emphasis by me)</super>:D:\Development> perl -MO=Deparse,-x3 -e "for ($i = 0; $i < 10; ++$i) { +print $i;}" $i = 0; while ($i < 10) { print $i; } continue { ++$i } -e syntax OK
turns intofor ($i = 0; $i < 10; ++$i) { print $i; }
Note that in a few cases this translation can't be perfectly carried back into the source code -- if the loop's initializer declares a my variable, for instance, it won't have the correct scope outside of the loop.$i = 0; while ($i < 10) { print $i; } continue { ++$i }
Yves / DeMerphq
---
Writing a good benchmark isnt as easy as it might look.
|
|---|