in reply to Re: What's the point of a labeled block without a loop?
in thread What's the point of a labeled block without a loop?
Is there any specific advantage to the label there?
That appears to work just as well with none (except you need a chomp).
I'm not much taken with "if $age does not contain a non-digit, were done". How about:
my $age; { print "Please enter your age: "; chomp( $age = <STDIN> ); redo if $age =~ /\D/; } Please enter your age: Mind your own Please enter your age: As old as m'tongue and a little older than m'teeth. Please enter your age: 300000000000
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: What's the point of a labeled block without a loop?
by dragonchild (Archbishop) on Dec 17, 2005 at 04:48 UTC | |
by Hue-Bond (Priest) on Dec 17, 2005 at 12:43 UTC | |
by Perl Mouse (Chaplain) on Dec 18, 2005 at 14:11 UTC |