open(READER, "file1") || die "$!"; open(WRITER, "+) { chomp; munge($_); mutilate($_); print WRITER "$_\n"; # Note the filehandle argument to print. }