N
newbie
Hi all,
I have the following simple file reading code, the files being read in is
fairly large (4 MB with 160,000 lines, but each line only contain like 3
strings).
open(FILEHANDLE, "<a.dat") || die "Can't open: $!\n";
chomp(@array1 = <FILEHANDLE>);
close FILEHANDLE;
#do somthing with @array1
open(FILEHANDLE, "<b.data") || die "Can't open: $!\n";
chomp(@array2 = <FILEHANDLE>);
close FILEHANDLE;
#do something with @array2
My problem is that the 1st time reading in the file is fine, but when I open
the filehandler the 2nd time, the program gets stuck. I think it's something
to do with the large file, because I try out with smaller files, and it
works fine. Can anyone help me? Thanks
While on file reading subject, is there a fast way of reading in large
files?
I have the following simple file reading code, the files being read in is
fairly large (4 MB with 160,000 lines, but each line only contain like 3
strings).
open(FILEHANDLE, "<a.dat") || die "Can't open: $!\n";
chomp(@array1 = <FILEHANDLE>);
close FILEHANDLE;
#do somthing with @array1
open(FILEHANDLE, "<b.data") || die "Can't open: $!\n";
chomp(@array2 = <FILEHANDLE>);
close FILEHANDLE;
#do something with @array2
My problem is that the 1st time reading in the file is fine, but when I open
the filehandler the 2nd time, the program gets stuck. I think it's something
to do with the large file, because I try out with smaller files, and it
works fine. Can anyone help me? Thanks
While on file reading subject, is there a fast way of reading in large
files?