Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

About List::Util's pure Perl shuffle()

by blazar (Canon)
on Jul 11, 2007 at 10:11 UTC ( #625977=perlmeditation: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub shuffle (@) {
      my @a=\(@_);
    ...
        (${$a[$n]}, $a[$n] = $a[$i])[0];
      } @_;
    }
    
  2. or download this
    #!/usr/bin/perl
    
    ...
    cmpthese -60, { map { $_ => "$_ 1..1000" } qw/naive listutil/ };
    
    __END__
    
  3. or download this
    C:\temp>perl lus.pl
              Rate    naive listutil
    naive    588/s       --     -14%
    listutil 684/s      16%       --
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://625977]
Approved by Mutant
Front-paged by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2015-07-31 06:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (274 votes), past polls