"John W. Krahn" wrote:
>
> #!/usr/bin/perl
> use warnings;
> use strict;
>
> ( $\, $^I ) = ( $/, '.bak' );
>
> while ( <> ) {
> s/^\s+//; # remove space at beginning of line
> s/\s+$//; # remove space at end of line
> s/\s*\|\s*/|/g; # remove space around pipe separator
Forgot one step, oops.
tr/ \t/ /s; # squash remaining space
> print;
> if ( eof ) {
> close ARGV;
> rename $ARGV, "${ARGV}_nice" or warn "Cannot rename $ARGV to ${ARGV}_nice:
> $!";
> }
> }
>
> __END__
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]