Perl::Script to find palindrome
From Biocourse
# =============================================================
#
# Author: Areum Han (arhan@ucla.edu)
#
# File Description:
# Script to find palindrome
#
# ============================================================
$text = "ABBA";
for($i=0;$i<length($text);$i++){
for($j=$i+1;$j<=length($text);$j++){
$buffer = substr($text, $i, $j-$i);
if(($buffer eq reverse($buffer)) && (length($buffer)!=1)){
print "palindrome : from ".$i." to ".$j."=\"".$buffer."\"\n";
}
}
}
