while (my $line = <$fh>){ chomp $line; $line =~s:\bMFG\b::g; $line =~s:\bDOME/GT\b::g; $line =~s:\bOG\b::g; push(@lines, $line); }