================================================================================ http://en.wikipedia.org/wiki/Palindrome A palindrome is a word, phrase, number or other sequence of units that has the property of reading the same in either direction (the adjustment of punctuation and spaces between words is generally permitted). ================================================================================ Write a program that can find the longest single word palindrome in a set of files. The program should support being called with a list of one or more input files: perl find-pal.pl in1.txt in2.txt in3.txt ... An example input file (pal1.txt) might be: ---------------------------------------- The most familiar palindromes, in English at least, are character-by-character: the written characters read the same backwards as forwards. Palindromes may consist of a single word (civic, level, racecar, rotator, Malayalam), or a phrase or sentence ("Neil, a trap! Sid is part alien!", "Was it a rat I saw?", "Mr. Owl ate my metal worm", "Sit on a potato pan, Otis", "Rats live on no evil star."). Spaces, punctuation and case are usually ignored. The Guinness Book of Records gives detartrated, the past tense of detartrate, a somewhat contrived chemical term meaning to remove tartrates. Rotavator, a trademarked name for an agricultural machine, is often listed in dictionaries. The term redivider (i.e. someone or something that redivides) is used by some writers but appears to be an invented term - only redivide and redivision appear in the "Shorter Oxford Dictionary". Malayalam, an Indian language, is of equal length (strictly, this name should be spelt either Malayaalam or Malay\u0101lam, as the next to last vowel is long.) Another aspect of the word "malayalam" is that it stays a letter palindrome if it is written in any phonetic script like devnagari. ---------------------------------------- When run as: perl find-pal.pl pal1.txt Which should result in the output: Longest in inp1.txt => Malayalam Longest over all was: inp1.txt => Malayalam