Trivial example:
print "Can you read this? "; my $answer = <STDIN>; if ($answer =~ /^y(?:es)?$/i) { print "Excellent\n"; } else { print "Then how did you answer?\n"; }
This has the benefit of accepting any of y, Y, yes, YES or Yes (to name a few).
In reply to Re: Interactive Perl script
by bv
in thread Interactive Perl script
by Irishboy24
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |