See that redo works on any block, it doesn't have to be a loop as in the documentation. It also loops when you enter a char, because it is using a numeric equality operator.use strict; { print "Insert Employee Number: "; # Prompts the user my $empNum = <>; # Gets input from STDIN redo if $empNum == 0; print "The employee number you entered was: $empNum\n"; }
-- iakobski
In reply to Re: easy as
by iakobski
in thread easy as
by NodeReaper
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |