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 <>;
In reply to Re: Palindrome Program without Reverse function
by Anonymous Monk
in thread Palindrome Program without Reverse function
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |