#!/usr/bin/perl -w use Strict; use File::Copy; open(FH,"; close(FH); my $newline; foreach my $filename (@files){ chomp($filename); open(FH,"<$filename"); my @body = ; close(FH); copy ($filename, $filename.'.bak'); my $oneline = join "",@body; if ($oneline =~ m!(.*?)(.*)(.*)!s) { $newline = $1.$3.$4; open(FH,">$filename"); print FH $newline; close(FH); } }