Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

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

by blazar (Canon)
on Jul 11, 2007 at 10:11 UTC ( [id://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
Domain Nodelet?
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?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (3)
As of 2024-04-25 06:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found