Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: foreach to for

by ioannis (Monsignor)
on Jun 19, 2006 at 09:07 UTC ( #556207=note: print w/replies, xml ) Need Help??

in reply to foreach to for

As shown bellow, the first for loop produces fixed iterations, and the second dives into infinite loop. Although expectations are not consistent, at least you get to chose which method to want.
## Fixed-length Loop my $i=6; for (0..$i) { print ; $i++; } #### Infinite Loop my @nums = 1..3; for (@nums) { push @nums, $_; print; }

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://556207]
[Tanktalus]: SwaJime: wouldn't status & status < 13 be true if status was 0?
[SwaJime]: I thought 0 was false, and false AND anything would be false ...
[SwaJime]: unless & is higher precedence than <
[SwaJime]: couldn't find bitwise in precedence list for sybase
[SwaJime]: I bet that is why ... and that makes it to be I think terribly written code :-|

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (9)
As of 2017-08-22 18:09 GMT
Find Nodes?
    Voting Booth?
    Who is your favorite scientist and why?

    Results (338 votes). Check out past polls.