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 iterate dictionary keys
  • establish an sftp connection using java
  • python count number of occurences in a string
  • tk python radio button
  • python iterate dict
  • perl palindrome check
  • python use math pi
  • python check if instance of
  • java right shift
  • perl external program

No comments yet.

Leave a Comment