Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Re: A few random questions from Learning Perl 3

by talexb (Chancellor)
on Jan 06, 2003 at 14:39 UTC ( [id://224637]=note: print w/replies, xml ) Need Help??


in reply to Re: A few random questions from Learning Perl 3
in thread A few random questions from Learning Perl 3

Excellent answer, with one small adjustment to the last example to do with redo ..

my $flag = 0; foreach (1..10) { print("$_ "); if ($_ == 9 && $flag != 1) { $flag=1; redo; } }

I have initialized flag to zero at the beginning of the loop. This was, of course, understood :) by all readers, but for the newcomer, it might be helpful.

--t. alex
Life is short: get busy!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (8)
As of 2024-04-23 12:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found