in reply to Edit a New file in place after reading it in
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; }
|
|---|