Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Why is the null while-loop condition expression true?

by Paladin (Vicar)
on Mar 28, 2016 at 18:31 UTC ( #1158970=note: print w/replies, xml ) Need Help??


in reply to Why is the null while-loop condition expression true?

From perlsyn (5.22.1 at least):
    As a special case, if the test in the "for" loop (or the corresponding
    "while" loop) is empty, it is treated as true. That is, both

        for (;;) {
            ...
        }

    and

        while () {
            ...
        }

    are treated as infinite loops.
  • Comment on Re: Why is the null while-loop condition expression true?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1158970]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (1)
As of 2022-05-22 15:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (80 votes). Check out past polls.

    Notices?