programming-examples/perl/SystemFunction/Using exit command to exit an program.pl

11 lines
223 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
print "Please type the letter y\n";
while (<>) {
chop;
if ($_ ne 'y') {
print "Please type the letter y\n";
} else {
print "Do you always do what you're told?\n";
exit;
}
}