Hi all,
On Thu, Sep 18, 2003 at 05:54:15PM +0200, Xavier Noria wrote:
[snip]
#
# My current favourite is
#
# -p s!\B\w+\B!join,sort{rand 2}$=~/./g!ge
#
[snip]
This is very nice (I didn't know about \B either); how randomly does
that scramble? I'm sure there's a thread somewhere on
Selon Yitzchak Scott-Thoennes [EMAIL PROTECTED]:
So is it unintentional that you can localize through an expression
resulting in a glob?
Er... I'd say it's correct but only half intentional.
The full story is here :
http://bugs6.perl.org/rt2/Ticket/Display.html?id=21321
On Thursday 18 September 2003 17:27, Xavier Noria wrote:
My current favourite is
-p s!\B\w+\B!join,sort{rand 2}$=~/./g!ge
but I am sure any serious golfer can shorten that substantially.
I am sorry for the duplicate, this was sent yesterday from an address
which is not subscribed to
In which case I can beat:
-pX s#\B\w+\B#join,map chop,sort map{rand.$_}$=~/./g#eg
With:
-p s#\B\w+\B#join,values%{{map{rand,$_}$=~/./g}}#eg
Greg
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Friday, September 19, 2003 2:11 PM
To: [EMAIL
Ton == Ton Hospel [EMAIL PROTECTED] writes:
This is very nice (I didn't know about \B either); how randomly does
that scramble? I'm sure there's a thread somewhere on that.
Ton Not very. The sort{rand 2} trick has been rejected in golfs before.
I don't know about current perl versions, but