The old and boring way to do it would be to open the file in read/write mode, read the contents into an array, make the changes to the array, rewind the file pointer, truncate the file handle and then write out the array. Oh, and don't forget to flock the file handle to stop anyone else trying to access the file.
But these days, it's much easier to just use Tie::File.
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
In reply to Re: Changing records in a text file
by davorg
in thread Changing records in a text file
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |