in reply to Search & Replace Across Two Files
Oh, and as a general observation, do check the return value of open. Opening a file may fail.