http://qs321.pair.com?node_id=382573


in reply to Finding longest palindrome from a string

A very humble attempt:
sub tune { my $l = ""; map {$l=$_ if ($_ eq reverse $_)&&(length $l<length $_)} split /\s ++/, $_[0]; return $l; }

--
tune

Replies are listed 'Best First'.
Re^2: Finding longest palindrome from a string
by tune (Curate) on Aug 13, 2004 at 08:49 UTC
    Oops, mine won't work with in-string palindromes. Disqualify me. =:(

    --
    tune