On Thu, 18 Sep 2003 08:44:45 +0100, Etienne Grossmann wrote:
>perl -pe 'sub r{join"",map chop,sort
>map{rand().$_}shift=~/(.)/g};s/\b(\w)(\w*)(\w)\b/$1.r($2).$3/eg'
I like the way you scramble the array. Very nifty.
For those people interested in this, I'd like to point out that there's
a thread on Perlmonks as well:
Txet Maglning Glof, Ayobndy?
<http://perlmonks.org/index.pl?node_id=291720>
Especially the idea of using the /\B/ anchor appeals to me.
Hmm... let's try it:
: perl -pe 'sub r{join"",map chop,sort map{rand.$_}shift=~/(.)/g};s/\B(\w+)\B/r$1/eg'
--
Bart.