Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Perl: Check if word is a palindrome

Perl: Check if word is a palindrome
{filelink=13223}

@mySequence=("Otto","Madam, I'm Adam", "demo");
foreach $word(@mySequence)
{
if ($word =~ /^(w+)w?(??{reverse $1})$/ )
{
    print "$word is a palindrome.
";
} else
{
    print "$word is not palindrome.
";
}
}

Users who found this page were searching for:

  • python count number of occurences in a string
  • perl external program
  • Tk python set focus
  • python use math pi
  • python iterate dict
  • python poplib email get text
  • perl palindrome check
  • tk python radio button
  • java right shift
  • check if a name is palindrome perl

No comments yet.

Leave a Comment