RichardH has asked for the wisdom of the Perl Monks concerning the following question:

Is there any quick way to remove all of the http headers from an http response and leave only the content of the page requested (assuming that the page is plain text)?

Replies are listed 'Best First'.
RE: http headers
by merlyn (Sage) on Jun 14, 2000 at 19:16 UTC
Re: http headers
by gnat (Beadle) on Jun 14, 2000 at 23:26 UTC
    $response =~ s/^.*?\n\n//s;
    
    But Randal's right, don't get it in the first place.
(jcwren) Re: http headers
by jcwren (Prior) on Jun 14, 2000 at 18:15 UTC
    Try this:
    #!/usr/local/bin/perl -w use strict; use HTML::Parser; sub HTML::Parser::text { shift; print shift; } HTML::Parser->new->parse_file ("test.html");
    You'll get a redefine warning. Ignore it.

    --Chris (master of the munged /msg...)