in reply to Palindrome Program without Reverse function
my $palindrome_re = qr{ \b (?<pal> # A palindrome is a sandwich... (?<char>\w) # starting with white bread... (?: # filled with either... \w? # peanut butter (maybe)... | # or... (?&pal) # another sandwich... ) \k<char> # topped off with white bread! ) \b }x; @ARGV = 'words'; /$palindrome_re/ and print while <>;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Palindrome Program without Reverse function
by BrowserUk (Patriarch) on Oct 31, 2011 at 05:02 UTC | |
|
Re^2: Palindrome Program without Reverse function
by ww (Archbishop) on Oct 31, 2011 at 13:49 UTC |