in reply to Improving a palindrome script...

Do what ikegami said and also throw in $palindrome =~ s/[^a-zA-Z]//g; in order to deal with things like danish custard.

-driver8

Replies are listed 'Best First'.
Re^2: Improving a palindrome script...
by Anonymous Monk on Oct 25, 2006 at 11:19 UTC
    Be aware that such an action would also ignore accented letters. You might want to use s/\w+//g, s/[[:word:]]+//g or s/\p{IsWord}+//g, depending whether locale and/or unicode is in effect.