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
|
|---|