Something like the following would work:
my $choice; while (1) { print "\nDo you want to continue : "; chomp($choice = <STDIN>); if ($choice eq "y" || $choice eq "n") { last; } else { print "\nERROR:Invalid Choice\n"; } }
Note: use eq and ne for string comparison. == and != are used for numerical comparisons
In reply to Re: Continure when "y" and none for "n"
by wind
in thread Continure when "y" and none for "n"
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |