|
Posted by PerlFAQ Server on April 26, 2005, 5:03 pm
Please log in for more thread options
>>
>> [snip]
>>
>> > if I print "$1\n",
>> > the file prints just fine. But, if I do something like print "$1 after
>> > \n", the whole output is messed up. If I print "before $1\n", nothing
>> > prints at all. If I print "before $1 after\n", only after prints.
>>
>> not really sure, but could be a rogue "\r" in $1,
> There
> is a rogue carriage return (0xd) in the string
> Is there something I can do to deal with this
> situation?
Repair the corrupted file:
perl -p -i -e 'tr/\r//d' bad_file
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
|