Click here to get back home

questions about RE!

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
questions about RE! Flamingo 02-09-2007
Get Chitika Premium
Posted by Peter Wyzl on February 9, 2007, 7:19 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

Posted by John W. Krahn on February 9, 2007, 7:32 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

Similar ThreadsPosted
"our" from XS and some other questions April 21, 2006, 4:54 am
Some questions about q{} and qr{}. April 13, 2008, 9:07 pm
Where to ask mysql questions? July 29, 2005, 7:55 pm
Hash questions August 4, 2005, 7:02 am
some perl questions October 24, 2005, 8:18 am
2 basics questions: 1)'a' < 'b' 2)Run, but is it ok? January 18, 2006, 9:13 am
concurrency with DBI questions February 28, 2006, 12:18 pm
Other XS progamming questions April 14, 2006, 10:33 am
Questions about Inline::C September 28, 2006, 3:58 am
Style questions January 25, 2007, 5:48 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap