in reply to Loop Control : REDO
As an aside, I thought that redo and friends were only applicable inside of while or foreach loops, but apparently, that's not the case. Hm!use strict; print "** Random 4 Lotto Numbers **\n"; print "** Type any four digits (0 to 9) **\n"; my @digit; foreach my $i (1..4){ while ($digit[$i] =~/^[\D]$/){ print "enter digit $i : "; chomp($digit[$i] =<>)}; } print "Your choices : @digit \n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (boo)Re: Loop Control : REDO
by iakobski (Pilgrim) on May 02, 2001 at 18:50 UTC | |
|
Re: (boo)Re: Loop Control : REDO
by suaveant (Parson) on May 02, 2001 at 18:28 UTC | |
by boo_radley (Parson) on May 02, 2001 at 18:51 UTC | |
by suaveant (Parson) on May 02, 2001 at 18:54 UTC |