Madhu Reddy wrote:
> Hi,
> We are doing file operations on large files(more
> than 5GB).....
> basically reading the file and validatiing the each
> record in in the file.....
>
> we used Tie::File
> It took 35 min to read and count the number of lines
> in file of 8millions (500MB)
>
> following is the script....
>
> Does anybody have any idea is there any good perl
> modules available for handling large files.......
Do you have any reason to access the file by a tied array.
Unless you really need to access the file quickly by line
number you would be far better off coding it normally
like this:
@ARGV = 'H:\Madhu\madhudb2.txt';
my $n_recs;
$n_recs++ while <>;
print $n_recs, "\n";
Also, you might try doing
$n_recs = @file_array;
a second time. I'm sure it will be quicker after Tie::File
has built its data structures.
Cheers,
Rob
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]