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