in reply to Edit a New file in place after reading it in

Help us help you with a Short, Self-Contained, Correct Example

Lines 44 - 63 of your sample code would have been sufficient, if I am understanding your question correctly.

my %substitutions = ( 'Xi Wong' => 'Lucca P.', 'MG5237ALL5X' => 'MG54 +15DP', 'SI' => 'SA' ); while (my $line = <$base_fh>) { foreach my $was (keys %substitutions) { $line =~ s/$was/$substitutions{$was}/g; } print $New_fh $line; }
But God demonstrates His own love toward us, in that while we were yet sinners, Christ died for us. Romans 5:8 (NASB)