in reply to Re^2: processing huge files
in thread processing huge files

I tried:

file.txt

# header 1 2 3 4 5 6
test.pl
use Tie::File; tie @f, 'Tie::File', "file.txt" or die $!; foreach (@f[1..$#f]) { print $_, "\n"; }
Result is:
1 2 3 4 5 6


Igor S. Lopes - izut
surrender to perl. your code, your rules.

Replies are listed 'Best First'.
Re^4: processing huge files
by geektron (Curate) on Aug 02, 2005 at 21:44 UTC
    yes, that works fine, but if you try to add the  mode option, at least for me it ignored the RO nature and threw the error.
      The cause of this error is that you opened it as O_RDONLY. When you pop() the arrayref, Tie::File tries to remove that line from file too. Do not use pop() to ignore the first line. Iterate starting from the end of your header as my first post or use some regex to ignore unwanted lines


      Igor S. Lopes - izut
      surrender to perl. your code, your rules.