# File: search.pl # Title: Input from keyboard a word and a sentence (two strings) # Check if the word is inside the sentence: $s =~ /$p/ # Do this until you want to. Continue(y/n)? # Author: Mihaela Malita # Input sentence? I am really happy # Input word? happy # happy is inside: I am really happy # Continue(y/n)? n # Bye $yesorno = 'y'; while ($yesorno eq 'y') { print "Input sentence? "; $s = ; chop($s); print "Input word? "; $p = ; chop($p); if ($s =~ /$p/) # use the operator =~ {print "$p is inside: $s";} else {print "the word $p is not found";} print("\nContinue(y/n)? "); $yesorno = ; chop($yesorno); } print "Bye"; exit;