Click here to get back home

Weird Module Interactions

 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
Weird Module Interactions roi.lists 11-21-2005
Get Chitika Premium
Posted by roi.lists on November 21, 2005, 1:20 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 Sisyphus on November 22, 2005, 8:50 am
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
weird bug April 18, 2008, 1:27 pm
weird failure with Net::FTP January 1, 2005, 11:05 am
a weird problem August 6, 2008, 1:49 pm
Weird Error message February 15, 2005, 8:59 pm
Weird socket happenings December 27, 2005, 7:44 am
Weird regexp problem May 4, 2006, 7:53 am
weird perl script January 25, 2007, 8:17 am
Weird character issue March 30, 2007, 1:14 pm
weird behavior with open and pipe June 30, 2005, 4:03 pm
Regular Expression Help - Weird Results December 6, 2005, 5:20 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap