in reply to Re: JAPH palindrome.
in thread JAPH palindrome.
if ($half1 =~ $flip)Really? It doesn't matter if $flip contain regexp special characters, or if $flip matches $half1 partially?
I'm also wondering why you bother splitting the text into two. Wouldn't something like:
be enough?use Test::More; use autodie; open my $fh, "<", $file; undef $/; $text = <$fh>; chomp $text; $text =~ s/\s+//g if $lax_in_whitespace; ok $text eq reverse $text, "palindrome"; done_testing;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: JAPH palindrome.
by jffry (Hermit) on Sep 26, 2010 at 07:09 UTC |