# File: palindrome.pl # Title: Check if a string is a palindrome # that is it is equal with its reverse: Ada, Anna, Bob, Eve, Hannah # Input from keyboard a string # Author: Mihaela Malita # Input a string? mom # It is a palindrome print "Input a string? "; $s = ; chop($s); # take last char that is $r = reverse($s); print "The reversed string is "; print $r; if ($r eq $s) #check if strings are equal {print "\nIt is a palindrome";} else {print "\nIt is NOT a palindrome";} exit;