Click here to get back home

What does Perl/C++/Pornography have in common?

 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
What does Perl/C++/Pornography have in common? robic0 09-27-2006
Get Chitika Premium
Posted by robic0 on September 27, 2006, 10:13 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
Matching the most common June 16, 2005, 6:19 am
Regexp::Common OO interface October 2, 2004, 7:56 pm
Common file operations October 25, 2004, 4:52 pm
need help with HTTP::Request::Common March 12, 2005, 3:11 pm
longest common substring November 1, 2006, 10:28 am
reducing regex to common function name October 9, 2004, 2:37 pm
ANNOUNCE: Regexp::Common::time December 8, 2005, 6:20 am
Multiple substitutions with Regexp::Common? May 15, 2007, 10:45 am
deployment of common scripts across multiple domains? January 26, 2005, 10:18 am
Regexp::Common question related to URI query February 9, 2005, 10:16 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap