in reply to Processing LARGE text files

Tie::File is often recommended for handling large files, see grab 'n' lines from a file above and below a /match/ for example.

I'm not really a human, but I play one on earth. flash japh

Replies are listed 'Best First'.
Re^2: Processing LARGE text files
by Craig720 (Initiate) on Mar 07, 2006 at 19:58 UTC
    I tried Tie::File quite some time ago. Unless I was using it incorrectly, I found it altered the source file itself.

    If I was using it correctly, then I cannot use Tie::File. I need the original documents from which I extract the data to be untouched.

    When processed data is posted to our website, the unaltered source document is also posted. A link to that source is posted adjacent to the processed data.

      I don't think you were using it correctly, or you had some other bug in your code. Are you suggesting that Tie::File has a bug? Look at the section 'mode' in "perldoc Tie::File" to see how to keep your file read-only.

      I'm not really a human, but I play one on earth. flash japh
        The only bugs crawling around are those in my code. Sheepish Grin.

        Thanks much for the suggestion about the read-only mode for that module and where to look for it. I am definitely going to study up on that and wire it into my script.

        Wish I knew about this earlier. Like last year maybe. Sigh. But I know now. I'm off to pound more code!