#!/usr//bin/perl -w use strict; use Getopt::Long; use IO::File; use constant USAGEMSG => < \$file, 'help' => \$help ); if ($help) { print "\nVersion: $vers\n"; die USAGEMSG; } if (not $file) { die USAGEMSG; } $fh = new IO::File("$file") or die "File not found: $!\n"; $tmp_fh = IO::File->new_tmpfile; until ($fh->eof()) { my $line = $fh->getline(); if ($line =~ /\cM/) { chop($line); chop($line); } print $tmp_fh "$line\n"; } $fh->close; $fh = new IO::File(">$file") or die "File not found: $!\n"; seek($tmp_fh,0,0); until ($tmp_fh->eof()) { my $line = $tmp_fh->getline(); print $fh $line; } $fh->close; $tmp_fh->close; exit;