#! /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();
In reply to Re: Advice on goto usage?
by Nevtlathiel
in thread Advice on goto usage?
by imperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |