in reply to Re: Fun with words (Golf?)
in thread Fun with words (Golf?)

++ for realizing that a fair shuffle isn't necessary. You can trim a few chars by getting rid of the rand call entirely, and using non-paired delimiters, $&, and an alternative to split:
s!\B\w+\B!join'',sort{1}$&=~/./g!eg

Caution: Contents may have been coded under pressure.

Replies are listed 'Best First'.
Re^3: Fun with words (Golf?)
by BrowserUk (Patriarch) on Nov 10, 2005 at 00:07 UTC

    Come to that, why bother with the comparison block at all :)

    s!\B\w+\B!join'',sort$&=~/./g!eg P:\test>junk Down taht path leis madenss. On the oehtr hand, the raod to hell is pa +evd with meilntg sabllnows. Aghlotuh the Perl Saglon is Tehre's More Tahn One Way to Do It, I haei +stte to make 10 ways to do sehimnotg. And don't tell me tehre isn't one bit of dceeffinre beeetwn nlul and s +acpe, bacesue taht's eacltxy how mcuh dceeffinre tehre is. Raadnl said it wloud be tgouh to do in sed. He ddin't say he ddin't ua +dennrstd sed. Raadnl uaddennrsts sed qitue well. Wchih is why he uess + Perl. As uasul, I'm oaeinrsttvg the case to kcnok a few nenorus loose, but t +he trtuh is uallsuy seehmorwe in the mddlue, uh, mddile. Of corsue, I reersve the rghit to make whlloy siptud caeghns to Perl i +f I think tehy imoprve the laaggnue.

    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.