Click here to get back home

How to suppress http headers during download

 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 suppress http headers during download soup_or_power 08-08-2005
Get Chitika Premium
Posted by soup_or_power on August 8, 2005, 11:22 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 soup_or_power on August 9, 2005, 7:41 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
Proper echoing of HTTP headers from LWP call ? October 17, 2007, 8:51 pm
How to handle a HTTP::Request with gzip, deflate headers December 3, 2004, 4:49 am
How do I do full access logging including HTTP headers? October 29, 2006, 4:56 pm
To get the HTTP response headers such as content length from a web server February 23, 2007, 6:16 am
Free perl reference ebook Download now | http://freepdf-ebook.blogspot.com/2007/12/tech-perl-programming-in-21-days.html December 11, 2007, 4:54 pm
Perl Extreme Programming download now | http://freepdf-ebook.blogspot.com/2007/12/extreme-perl-programming.html December 25, 2007, 3:28 pm
Suppress warning April 20, 2007, 10:53 am
cpan -- suppress questions May 13, 2007, 5:44 am
suppress regex parsing in interpolated string February 28, 2006, 2:08 pm
HTTP Proxy via HTTP Layer by Perl? October 19, 2004, 5:56 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap