Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
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 making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2014-09-21 13:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (171 votes), past polls