Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: until loops

by lvanhout (Curate)
on Jun 16, 2004 at 05:11 UTC ( #367116=note: print w/replies, xml ) Need Help??


in reply to until loops

I usually find it a little cleaner to say
until($year >= 2000)
That is to say continue until year is greater than or equal to 2000. In case you go back and change your code within the loop and do something more complicated than increment.

Unless you really mean that only 2000 is an escape loop case and 2001 and up will be continue loop cases.

Replies are listed 'Best First'.
Re^2: until loops
by apotheon (Deacon) on Oct 11, 2004 at 00:05 UTC
    On the other hand, with only the == instead of >=, it's a perfectly appropriate demonstration of the concept. I'm not sure, but if compiled, the == might actually execute faster than the >=, though by such a minute margin that it's effectively useless to differentiate.

    - apotheon
    CopyWrite Chad Perrin

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://367116]
help
Chatterbox?
[james28909]: ok i have a new question ;)
[james28909]: i am not sure how to ask google this either
[james28909]: i am getting the current time on my machine with scalar localtime;
[james28909]: i am scraping a website and retrieving a date stamp of an article.
[james28909]: well time/data stamp of the article
[stevieb]: james28909: what's the problem/question?
[james28909]: it is not an absolute date like "27" or "31". sometimes it is like wednesday or friday

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2017-04-29 02:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (531 votes). Check out past polls.