in reply to Re^2: replace field
in thread replace field

Maybe you could use Tie::File ? You can process the file as an array and modify the lines in place using ikegami's suggestion.
HTH!

Just a something something...