Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Re: for vs. while question

by MrNobo1024 (Hermit)
on Mar 07, 2001 at 05:50 UTC ( [id://62651]=note: print w/replies, xml ) Need Help??


in reply to Re: for vs. while question
in thread for vs. while question

Won't that put it outside of the loop (so it's only executed once)?

Replies are listed 'Best First'.
Re: Re: Re: for vs. while question
by merlyn (Sage) on Mar 07, 2001 at 05:57 UTC
    Blimey yes. Ugh. OK, make it the conditional then:
    for (;$BASKET and (my @socks = $BASKET -> can_read(2)) or 1); ) { ... }
    and now it's nearly like the original non-for code.

    Probably simpler just to use the while. {grin}

    -- Randal L. Schwartz, Perl hacker

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (9)
As of 2024-03-28 09:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found