Gisle Aas wrote:
Mattias Holmlund <[EMAIL PROTECTED]> writes:
Gisle Aas wrote:
It is documented (barely) that the module export the variable '$ua'.
A side effect of importing this variable is that this forces the full
LWP::UserAgent implementation to be used, otherwise settings on the
$ua object would have no effect. I want to declare this as the
official interface to force this and not document either get_old or
$FULL_LWP.
In HTTP::Cache::Transparent, I override LWP::UserAgent::simple_request
and set $LWP::Simple::FULL_LWP to 1 to make sure that the full
LWP::UserAgent implementation is always used. I do this without
actually loading LWP::Simple, since HTTP::Cache::Transparent doesn't
need LWP::Simple and some users may prefer to use LWP::UserAgent
instead of LWP::Simple.
With your proposal of an "official interface", I have to load
LWP::Simple to be able to achieve the same effect. This is not a big
issue, but it will consume memory unnecessarily. Do you think I should
change this in HTTP::Cache::Transparent?
I would just keep it as it is. This seems reasonable as long as you are
aware that you are playing outside of the documented interface and are
preparared to deal with the consequences if the internals of
LWP::Simple should change in the future.
Well, by overloading simple_request, I am already poking at the internal
details of LWP I guess. I'll leave it as it is for now.
/Mattias
Regards,
Gisle