The simple question: Is there an elegant way of readding all the files in a directory? If anybody if familiar with Perl, I'm looking for something like readdir().
The reason why I want to know: I'm writing a program that compiles data from several different files (all of the same format). The idea is that data entry can take place on a number of different machines at the same time and saved to a file on each machine. Then all the files would be put together and this program (that I'm currently writing) would go through each one in the same manner and read the data.
I already have a mechanism for reading the data from a single file, and I believe it's easily expandable with more than one file. My problem is how to find and open those files, which may be called
data0001.dat
data0002.dat
:
data1234.dat, etc.
This is why I'm looking for a way to read the files in a directory, instead of trying all 10,000 variations on this particular name (especially if I decide not to use numbers in the file name). Thanks in advance for any help!
--dave