in reply to Changing records in a text file
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Changing records in a text file
by Anonymous Monk on Nov 15, 2006 at 16:48 UTC |