programming-examples/perl/Statement/Use until to read user input.pl

9 lines
177 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
#!/usr/bin/perl
print "Are you o.k.? ";
chomp($answer=<STDIN>);
until ($answer eq "yes"){
sleep(1);
print "Are you o.k. yet? ";
chomp($answer=<STDIN>);
}