in reply to Re: generating merged data from matching id in 2 files
in thread generating merged data from matching id in 2 files

I think that using Tie::File in this particular case (when sequentially iterating over the records) doesn't provide any advantage over simply reading line by line from a normal file handle (rather, it's likely to be slower, due to the much more complex things going on under the hood...).

That is,

tie my @file1_arr, 'Tie::File', $file1, mode => O_RDONLY; foreach my $record ( @file1_arr) { # ... } untie @file1_arr; # finished with file 1

would become

open my $fh, "<", $file1 or die "Couldn't open '$file1': $!"; while (my $record = <$fh>) { # ... } close $fh;

(ditto for $file2)