Tony Davis
07-08-2005, 08:36 PM
I have always read files into an array as a whole (as in the following code). I am not sure I know how to do it any other way. Is the general consensus that this is less efficient than reading one record at a time (assuming that the file is, let's say, between 1,000 and 10,000 records). And by the way, the file is a .txt file.
open(HANDLE, $data_file);
open(DAT, $data_file) || die("Could not open file, $data_file");
@rawdata=<DAT>;
close(DAT);
Thanks,
-tdavis
open(HANDLE, $data_file);
open(DAT, $data_file) || die("Could not open file, $data_file");
@rawdata=<DAT>;
close(DAT);
Thanks,
-tdavis