Click here to get back home

LWP::UserAgent infinite hang

 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
LWP::UserAgent infinite hang Tomek 03-05-2007
Posted by Tomek on March 5, 2007, 6:18 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 Mumia W. on March 5, 2007, 11:50 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
LWP seems to hang August 9, 2006, 3:21 pm
ActiveState PPM/PPM3 just hang up for me August 14, 2004, 9:17 pm
can't get out of infinite while loop August 17, 2007, 4:14 pm
backticks with threads or forks hang program February 16, 2005, 6:18 am
infinite loop (newbie) March 8, 2005, 2:52 pm
Multipart form upload causes script to hang after 16K printed July 27, 2004, 9:21 am
MIME::Tools infinite loop June 20, 2005, 7:18 am
infinite loop to monitor directories May 13, 2008, 2:43 pm
infinite loop when perl is trying to print warning November 22, 2007, 10:29 am
OLE & Excel - Opening causes Excel.exe to hang around April 21, 2005, 1: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