Click here to get back home

tricks against WWW::Mechanize

 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
tricks against WWW::Mechanize noone 04-10-2005
Get Chitika Premium
Posted by noone on April 10, 2005, 6:48 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 ioneabu on April 10, 2005, 1:23 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
map tricks September 3, 2006, 5:21 pm
HEREDOC tricks, etc. October 28, 2007, 5:13 pm
any tricks to sending XML to .NET web service? January 19, 2006, 6:01 pm
Hash of array access tricks. Sorry, long. October 14, 2005, 5:43 pm
>>>>>>>>>>>>>>> FREE TIPS & TRICKS ON HOW TO GET YOUR HOME LOAN APPROVED November 24, 2007, 6:59 am
INTO FREE COMPUTER GEAR? FREE SAMSUNG 17" LCD Monitor NO TRICKS-NO SCAM-NO PURCHASE! February 22, 2005, 2:57 pm
hacking,anti-hacking,registry tweaks,compter tricks September 25, 2007, 5:24 am
use WWW::Mechanize; May 11, 2006, 6:28 pm
LWP::UserAgent & Mechanize August 1, 2004, 5:44 am
Understanding Mechanize August 19, 2005, 4:23 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap