in reply to Script to update a value in text file
Try Tie::File for editing a file in place via a Perl array.
Update: Link fixed.