- or download this
while (<>) {
if ($_ eq /yes/ or /y.*/) {
...
exit;
}
}
- or download this
my $ans = <STDIN>;
print "\n$word1 $word2 $word3 $word4\n" if ($ans =~ /^y/);
- or download this
print "\n$word1 $word2 $word3 $word4\n" if (($ans = <STDIN>) =~ /^y/);