Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

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

by talexb (Canon)
on Jan 06, 2003 at 14:39 UTC ( #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
Node Status?
node history
Node Type: note [id://224637]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2020-02-24 03:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What numbers are you going to focus on primarily in 2020?










    Results (104 votes). Check out past polls.

    Notices?