in reply to Re: Better way to work with large TSV files?
in thread Better way to work with large TSV files?

How is File::ReadBackwards a substitute for Tie::File for this application?


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
"Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon

Replies are listed 'Best First'.
Re^3: Better way to work with large TSV files?
by Aristotle (Chancellor) on Aug 20, 2004 at 18:02 UTC
    $sth->prepare( "INSERT INTO Blah ( a, b, c ) VALUES ( ?, ?, ? )" ); tie *TSV, 'File::ReadBackwards', $filename; while( <TSV> ) { my @insert = processRow( $_ ); $sth->execute( @insert ); truncate $filename, tell TSV; } close TSV; unlink $filename unless $errors;

    Makeshifts last the longest.

      I've tried this out, given the speed at which I was able to modify my existing code to work that way. The cpan://File::ReadBackwards module works tremendously well, with far less of a processor hit. I've noted a speed improvement of abour 500%!

      Thank you, Aristotle; I never would have found that module.

      --
      $me = rand($hacker{perl});