Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Hashing the order out of an array (Re: Randomize an array)

by tye (Sage)
on Sep 11, 2000 at 19:37 UTC ( #31900=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    values %{ map { rand() => $_ } @list };
    
  2. or download this
    sub { my %hash; for(@list){ $hash{rand()}= $_ }; return values %hash }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://31900]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2019-05-25 09:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you enjoy 3D movies?



    Results (152 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!