Click here to get back home

Problem With WWW::Mechanize With

 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
Problem With WWW::Mechanize With Hal Vaughan 07-14-2005
Posted by Hal Vaughan on July 14, 2005, 1:05 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 attn.steven.kuo@gmail.com on July 14, 2005, 7:00 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
HTTP::Request::Form - Can't submit a form with input type=image button January 31, 2005, 11:42 pm
HTTP::Recorder and WWW::Mechanize for testing web sites April 18, 2008, 12:33 pm
Getting WWW::Mechanize to submit a form September 13, 2007, 11:58 am
Form submit with mechanize 0.72 February 23, 2008, 8:38 am
Posting UTF-8 form data with WWW::Mechanize and LWP May 11, 2005, 7:12 pm
submitting a form with no name attribute with mechanize November 2, 2006, 7:44 pm
WWW:Mechanize single quotes around URL causes problem January 12, 2007, 11:54 am
Win32::IE::Mechanize multiple frame problem November 9, 2004, 7:13 am
Problem Installing HTTP::Client October 19, 2005, 3:50 am
Strange HTTP Socket connexion problem October 16, 2005, 5:02 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap