http://www.perlmonks.org?node_id=31480


in reply to RE (tilly) 2: Randomize an array
in thread Randomize an array

I completely agree with you. 0 should not be here. It's just that we talked about

sort { rand(3) - 1 } @array
at the september 1999 Paris.pm meeting.

I just remembered the sort rand trick and shared it. So here comes an updated version:

sort { (-1,1)[rand 2] } @array