Hello Melvin, Give this a try. I used the advice Jim gave and this is what I came up with. It seems to do what you are asking for.
#!/usr/bin/perl use warnings; use strict; my $inFile = "input.txt"; my $outFile = "output.txt"; open my $fin, '<', $inFile or die "ERROR opening $inFile: $!"; open my $out, '>', $outFile or die "ERROR opening $outFile: $!"; while( my $line = <$fin> ) { $line =~ s/baby/bigboy/g; print $out $line; } HTH, Chris -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/