Click here to get back home

Logging onto a Website

 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
Logging onto a Website RevKass 08-27-2007
Posted by RevKass on August 27, 2007, 12:03 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 usenet on August 27, 2007, 12:10 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
Logging into and parsing a website using Perl February 15, 2005, 10:11 pm
Logging UDP Packets November 5, 2004, 3:35 pm
Perl LWP, logging into yahoo etc ? October 6, 2005, 12:19 pm
Logging Errors (Instead of Just Dying) November 26, 2005, 4:35 pm
[Net::Jabber] problem with logging May 15, 2006, 9:39 am
CGI file based logging March 4, 2008, 10:59 pm
Logging with Log::StdLog from within a package July 31, 2008, 1:35 am
Net:SSH::Perl hangs while logging into SSH2 server January 13, 2006, 10:19 am
How do I do full access logging including HTTP headers? October 29, 2006, 4:56 pm
PERL can't open file for logging (world writable directory Windows XP Home/ Active Perl / Apache) November 8, 2006, 5:50 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap