Click here to get back home

Parse website that requires login

 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
Parse website that requires login Nalli 03-15-2007
Posted by Nalli on March 15, 2007, 3: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 cmic on March 15, 2007, 5:21 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
automate website login using perl September 23, 2005, 6:04 pm
Redirecting to my own login page instead of Apache Login March 24, 2008, 12:22 am
best practice ... requires August 23, 2007, 9:39 pm
requires explicit package name January 6, 2005, 6:10 pm
form requires two parameters August 14, 2007, 9:48 pm
Newb requires help with javascript submit September 6, 2004, 1:53 pm
counting perl src when have nested requires? January 23, 2005, 5:41 am
interacting with another program that requires input May 5, 2008, 2:37 pm
Global symbol requires explicit package name November 4, 2004, 9:46 pm
"use module" and %INC and multiple requires to same perl file April 18, 2006, 12:09 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap