Very likely you're looking at the first part of the windows linebreak (\r\n). Try running this code with the filename as the argument:
#!/usr/bin/perl -w
use strict;
while (my $fname = shift) {
next unless -f $fname;
open F,"<$fname" or die "Cannot open $fname: $!\n";
my $file = join('',<F>);
close F;
$file =~ s/\r\n?/\n/g;
open F,">$fname" or die "Cannot write $fname: $!\n";
print F $file;
close F;
}
See the Newlines section in perlport for more info.
--
#!/usr/bin/perl -np
BEGIN{@ARGV=$0}s(^([^=].*)|=)()s;
=Just another perl hacker
|