in reply to Performance Question

I would reccomend using Tie::File for this.
Frankly, rewriting the whole file to change just a few lines is a problematic situation with flat files. Although I would prefer some sort of database backend, Tie::File gives a database, without any necessary fields, etc.

You can read about Tie::File (Writen by Dominus) here, or go to cpan and download the module. Here's an example of how to edit a file from his article.
tie @lines, 'Tie::File', 'file' or die ...; for (@lines) { # Do your thing, only for lines that match this regex, or ar +e records that need to be changed. } untie @lines;
It should be quicker.
Gyan Kapur
gyan.kapur@rhhllp.com

Replies are listed 'Best First'.
Re: Re: Tie::File
by BUU (Prior) on May 09, 2002 at 03:10 UTC
    It might (dunno..) be quicker if your just changing a few dozen lines but if your trying to change *alot* of lines then its going tobe much, much slower.