in reply to Advice on goto usage?
#! /usr/bin/perl use strict; use warnings; sub get_input { print "Type R to re-enter the values or Type E to exit:\n"; chomp (my $value = <STDIN>); $value; } my $value = get_input(); while ($value ne 'E') { if ($value eq 'R') { $value = get_input; } else { print 'Invalid entry, please try again\n'; get_input; } } exit();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Advice on goto usage?
by Limbic~Region (Chancellor) on May 05, 2005 at 13:19 UTC | |
|
Scheduling
by imperl (Novice) on May 05, 2005 at 10:03 UTC |