in reply to Re: Palindrome Program without Reverse functionin thread Palindrome Program without Reverse function
Clever, but slow:
sub isPalindrome{ substr( $_[0], $_, 1 ) eq substr( $_[0], -($_+1), 1 ) or return for 0 .. length( $_[0] ) >> 1; 1; } [download]