Click here to get back home

how to retrieve the header information from a html page ???

 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
how to retrieve the header information from a html page ??? senthilS 03-24-2005
Posted by senthilS on March 24, 2005, 12:41 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 Sherm Pendley on March 24, 2005, 5:07 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
*.pl(in server) get http header information(from client) failed September 10, 2004, 5:22 pm
Format : page header April 19, 2006, 1:34 am
PERL + Repeat header on every page while printing excel December 28, 2007, 7:13 am
PERL/HTML: extract repetitive information July 11, 2007, 4:05 am
XP prints out html not page ? August 28, 2004, 9:37 pm
Editing HTML Page July 18, 2008, 2:20 pm
Download a HTML page with images? April 25, 2005, 8:24 am
replace variable in html page May 18, 2005, 4:23 pm
need to generate HTML page which may have tables December 1, 2005, 11:38 pm
calling perl from html page January 2, 2008, 3:11 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap