From: Xavier Noria Date: 2003-09-17T03:20:53+09:00 Subject: Re: scrambler one-liner On Tuesday 16 September 2003 20:07, Kurt M. Dresner wrote: > This is hilarious, because a friend and I just had (over lunch) a > race to see who could code it up first. I used Ruby and he used > Perl. Mine worked first, but then I reworked it a bit to make it > neater. His was impossible to read, but I totally have to send him > this one-liner. Man, sort_by{rand} is so awesome! I can't believe I > didn't think of that! Cool! :-) I have just written this version even shorter: -pe 'gsub!(/(\w)(\w+)(?=\w)/){$1+$2.split(//).sort_by{rand}.to_s}' -- fxn