Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Randomize an array

by lhoward (Vicar)
on Sep 08, 2000 at 00:07 UTC ( #31467=note: print w/replies, xml ) Need Help??


in reply to Randomize an array

By "randomize" I assume you mean "shuffle" (rearrange all the elements in a random fashion). The fastest and probably best way is to use the Algorithm::Numerical::Shuffle.
use Algorithm::Numerical::Shuffle qw /shuffle/; @shuffled = shuffle (1, 2, 3, 4, 5, 6, 7);

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2019-08-22 03:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?