Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Opening random files then reading random lines from file.

by BillKSmith (Monsignor)
on Apr 27, 2012 at 15:26 UTC ( [id://967667]=note: print w/replies, xml ) Need Help??


in reply to Opening random files then reading random lines from file.

You say that you want to open random files (plural). If you really mean to open all the files in random order (no repeats) you have more to do than putting one of the previous suggestions in a loop. You should 'shuffle' the list of file names and then open the files in the order of the shuffled list. The "Perl Cookbook" also discusses this in some detail. I recommend the shuffle function in the module List::Util

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-03-29 13:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found