# File: palindrome1.pl # Title: Check if a string is a palindrome # that is: it is equal with its reverse # Input from keyboard a string. Do this until you want to. # Author: Mihaela Malita # Input a string? mom # It is a palindrome # Continue(y/n)? y # Input a string? Mel # It is NOT a palindrome # Continue(y/n)? n # Bye $yesorno = "y"; while ($yesorno eq "y") { print "Input a string? "; $s = ; chop($s); # delete last char that is $r = reverse($s); if ($s eq $r) {print "It is a palindrome";} else {print "It is NOT a palindrome";} print ("\nContinue(y/n)? "); $yesorno = ; chop($yesorno); # read answerr and delete } print "Bye"; exit;