Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^6: last in a do while loop (for (;;))

by rir (Vicar)
on Jan 23, 2008 at 17:46 UTC ( [id://663843]=note: print w/replies, xml ) Need Help??


in reply to Re^5: last in a do while loop (for (;;))
in thread last in a do while loop

Update: Duplicative, nothing new here, move along.

Add a block or single-pass loop around your do while.

my $i = 0; { do { print $i++, $/; last if $i == 2; } while ( $i < 4); }
Be well,
rir

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (1)
As of 2024-04-25 01:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found