in reply to Net::HTTP::Methods and LWP::UserAgent

LWP::UA will call LWP::Protocol::create in order to get the implementor for a given scheme. You can use LWP::Protocol::implementor to set a custom subclass as the handler for the http scheme, and in your custom subclass (which should more or less inherit directly from LWP::Protocol::http) you should be able to override the default header lines value.

I used to have an example which showed how to do this for something similar (overriding the IO::Socket to use a specific source address) but I can't find it for the life of me . . . aaaah, thank you Wayback Machine: lwplocal.plx.

The cake is a lie.
The cake is a lie.
The cake is a lie.

Replies are listed 'Best First'.
Re^2: Net::HTTP::Methods and LWP::UserAgent
by flipper (Beadle) on Sep 26, 2008 at 18:14 UTC
    Perfect, I ended up with:
    #!/usr/bin/perl -w package MyHTTP; use base qw(LWP::Protocol::http); sub _new_socket { my $self=shift; my $ret =$self->SUPER::_new_socket(@_); $ret->max_header_lines(1000); return $ret; } package MyHTTP::Socket; use vars qw(@ISA); @ISA = qw(LWP::Protocol::http::SocketMethods Net::HTTP); package main; LWP::Protocol::implementor( 'http', 'MyHTTP' ); use LWP::Simple qw( getprint ); getprint( shift || 'http://localhost/' ); exit 0; __END__

    Hopefully that's unobtrusive enough... Many thanks!
      or even
      package MyHTTP::Socket; use vars qw(@ISA); @ISA = qw(LWP::Protocol::http::Socket);