Palindrome detection
say "noon".is_palindrome # truefunc palindrome(s) {
s == s.reverse
}func palindrome(s) {
if (s.len <= 1) {
true
}
elsif (s.first != s.last) {
false
}
else {
__FUNC__(s.first(-1).last(-1))
}
}Last updated