in reply to Re: Replace value in the text file
in thread Replace value in the text file

use autodie; for error checking, see autodie