title: What's the efficiency and quality of this shuffling algorithm?
body: <p>This recent question about <a href="https://stackoverflow.com/questions/375351/most-efficient-way-to-randomly-sort-shuffle-a-list-of-integers-in-c">sorting randomly using C#</a> got me thinking about the way I've sometimes shuffled my arrays in Perl.</p>
  
  <pre><code>@shuffled = sort { rand() &lt;=&gt; rand() } @array;
  </code></pre>
  
  <p>The proposed solution in the mentioned question is <a href="http://en.wikipedia.org/wiki/Fisher-Yates_shuffle" rel="nofollow noreferrer">Fisher-Yates shuffle</a>, which works in a linear time.</p>
  
  <p>The question is: how efficient is my snippet and is such shuffle "really" random?</p>