exiting from do

C

chatiman

Hello,

According to the "perldoc -f last" page it is not possible to exit from a
"do" loop with last.

How can I do that so ?
 
D

Dave Cardwell

----- Original Message -----
From: "chatiman" <[email protected]>
Newsgroups: comp.lang.perl.misc
Sent: Tuesday, February 24, 2004 10:36 AM
Subject: exiting from do

Hello,

According to the "perldoc -f last" page it is not possible to exit from a
"do" loop with last.

How can I do that so ?

LOOP: {
do {
last if $x = $y**2;
# do something here
} while $x++ <= $z;
}

emulates the "last" command.

See "perldoc perlsyn" for more details.

Regards,
 
T

Tore Aursand

According to the "perldoc -f last" page it is not possible to exit from a
"do" loop with last.

How can I do that so ?

According to the 'perldoc -f last' page, you can't. You said it yourself
two line breaks ago, remember?

Show us your code, and I'm sure we'll be able to rewrite it so that you it
works as it should.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top