Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

RE: random sort of list

by BlaisePascal (Monk)
on Sep 08, 2000 at 19:22 UTC ( [id://31603]=note: print w/replies, xml ) Need Help??


in reply to "a random sort of list"

I'd suggest using glob() to grab the file listing, randomizing that using the permutation code that floats around here alot, and then doing the foreach on that...
print "Content-type: text/htlp\n\n"; $n=1; @files = glob("random/*.html); fisher_yates_shuffle(@files); # see the Perl Cookbook for this functio +n foreach $file (@files) { ... }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2024-03-28 10:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found