2011-01-07 03:36:11 +00:00
|
|
|
#!/usr/bin/env perl
|
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
|
|
|
|
use IO::File;
|
|
|
|
use File::Basename;
|
|
|
|
|
|
|
|
|
|
|
|
my $script = basename($0);
|
|
|
|
my $USAGE = <<USAGE
|
|
|
|
Usage: $script <infile>
|
|
|
|
USAGE
|
|
|
|
;
|
|
|
|
|
|
|
|
if (!defined $ARGV[0]) {
|
|
|
|
die $USAGE;
|
|
|
|
}
|
|
|
|
|
|
|
|
my $infile = $ARGV[0];
|
|
|
|
open(DAT, $infile) or die "$infile: $!";
|
2011-01-07 03:44:53 +00:00
|
|
|
my @cleaned = ();
|
|
|
|
foreach my $line (<DAT>) {
|
|
|
|
$line =~ s/\s*$//;
|
|
|
|
$cleaned[++$#cleaned] = $line;
|
|
|
|
}
|
|
|
|
|
|
|
|
print join("|", @cleaned) . "\n";
|
2011-01-07 03:36:11 +00:00
|
|
|
|
|
|
|
close(DAT);
|
|
|
|
|
|
|
|
|
|
|
|
1;
|
|
|
|
__END__
|