Click here to get back home

Net::Google error handling

 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
Net::Google error handling s_p_a_m_mob 03-07-2005
Posted by s_p_a_m_mob on March 7, 2005, 9:02 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

Posted by s_p_a_m_mob on March 7, 2005, 9:05 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
cp error handling September 17, 2004, 4:06 am
Error handling July 4, 2007, 6:21 am
Error Handling in Net::SSH::Perl November 13, 2006, 3:58 pm
Best error handling mechanism? June 4, 2007, 9:13 pm
mySQL error handling with PERL June 21, 2005, 9:37 am
Net::Telnet Error handling/trapping February 5, 2007, 4:38 pm
Error in Handling Unicode(UTF16-LE) File & String May 6, 2008, 4:00 am
###############GOOGLE MONEY Earn BILLIONS through GOOGLE Without Investment November 24, 2007, 1:29 am
Top in Google November 22, 2005, 4:35 pm
Net::Google December 12, 2006, 5:55 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap