in reply to inserting/deleting file data

You might find that Tie::File in conjunction with pack might make your life simpler. You need to select you pack formats very carefully to match the format of your data.

Examine what is said, not who speaks.
1) When a distinguished but elderly scientist states that something is possible, he is almost certainly right. When he states that something is impossible, he is very probably wrong.
2) The only way of discovering the limits of the possible is to venture a little way past them into the impossible
3) Any sufficiently advanced technology is indistinguishable from magic.
Arthur C. Clarke.

Replies are listed 'Best First'.
Re: Re: inserting/deleting file data
by pg (Canon) on Mar 23, 2003 at 17:00 UTC
    Agreed with BrowserUk. Tie::File is the most ideal in this case.

    As Tie::File hides the physical layout at some level (the layout among lines, obviously you still need to worry the internal structure of each record, which is your pack), and now each line of the file is presented as an element of an array.

    I had a post analyzing how Tie::File uses memory, and you would see that Tie::File's author used memory in a very smart way.