in reply to Re: Updating a text filein thread Updating a text file
Or use Tie::File as suggested in this related node: "Re: Use of grep and foreach"