in reply to Updating fields in a text file
You might find that Tie::File could be used for something like this.