[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] nuts is stun spelled backwards





On Mon, 16 Oct 2000, Ronald J Kimball wrote:
> 
> perl -nle'$h{$r=reverse}?push@w,"$r $_":$h{$_}++;END{map print,sort@w}'

Assuming the word list is alphabetized helps a lot.  (This wasn't
explicitly stated in the original post, but should be true for any
reasonable list.)

  perl -nle'$h{$r=reverse}?print"$_ $r":$h{$_}++'  /usr/dict/words

-- 
Ilmari Karonen - http://www.sci.fi/~iltzu/
"And, should you resort to sticking a martini olive up their nose,
 implacable universal laws require that they'll _like_ that sort of
 thing."  -- Graydon in r.a.sf.c



==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe