Perl-Sensitive Sunglasses | |
PerlMonks |
Re: The evolution of a solution to the 11/23 NPR puzzler.by benizi (Hermit) |
on Jan 20, 2004 at 14:05 UTC ( [id://322585]=note: print w/replies, xml ) | Need Help?? |
Since nobody's posted a one-liner yet: perl -lne '$_=lc; next if $d{$_}++; next unless s/(?:m|rn)$//; print "${_}m / ${_}rn" if $h{$_}++' /usr/share/dict/wordsDoesn't quite handle capitalization correctly. e.g. "bim / barn", where bim is only in as "Bim". And even though all these solutions print pairs of words... I don't see the answer. (benizi guesses he'll be kicking himself later for admitting that) Update: ++halley. (Never having heard the expression, benizi refrains from kicking himself.)
In Section
Cool Uses for Perl
|
|