Click here to get back home

Next Page gets downloaded in Perl

 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
Next Page gets downloaded in Perl Praki 12-13-2007
Posted by Praki on December 13, 2007, 1:19 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 Paul Lalli on December 13, 2007, 8:44 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 Praki on December 13, 2007, 1:56 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
LWP user agent grabs the intermediate wait page after POST intead of the actual result page February 12, 2008, 12:50 am
manage a web page perl May 10, 2006, 3:44 pm
how to use perl to redirect web page? March 22, 2007, 8:44 pm
Login page perl/CGI April 27, 2007, 1:47 am
Example of perl script downloading a web page? December 23, 2004, 9:24 am
[perl-python] get web page programatically February 4, 2005, 12:01 pm
Perl robot uploading to ASP Web page September 8, 2005, 7:49 pm
calling perl from html page January 2, 2008, 3:11 pm
Need Perl module to get tag of a web page</a></td><td class="normal"> March 17, 2008, 4:32 pm</td></tr> <tr><td class="bold"><a href="/forums/Net-SSH-Perl-to-connect-to-a-remote-server-via-a-web-page-article3952--6.htm" >Net::SSH::Perl to connect to a remote server via a web page</a></td><td class="normal"> August 30, 2004, 10:07 am</td></tr> </table> <!-- google_ad_section_end --> </tr> </table> </td> <TD valign="top"> </TD> </tr> </table> </td></tr></table> <br> <table border="0" width="90%" cellspacing="0" cellpadding="0" class="bordercolor" align="center"><tr><td> <table border="0" width="100%" cellpadding="3" cellspacing="0" bgcolor="#FFFFFF"> <tr> <td bgcolor="#FFFFFF" valign="middle" align="center" colspan="3"> <!-- google_ad_section_start(weight=ignore) --> <span class="small"> <p align="center">Our other projects:</p> <p align="center"><a href="http://www.sunnyfaces.net">Art Dolls, Fairies and Mermaids - Sunnyfaces.net</a></p> <a href="http://www.schestowitz.com/UseNet/" title="Roy's messages about Linux, Search Engines and computer programming" target="_blank">Roy's Linux, Programming and Search Engines messages</a><br> <br/> <a href="/sitemap.xml"><img src="/images/xml.gif" alt="1-Script XML Sitemap" border = "0">XML Sitemap</a> <br/> <!-- Page generated in 0.05 seconds. --></span> <!-- google_ad_section_end --> </td> </tr> </table> </td></tr></table> </body> </html>