I'm running the following
perl-5.8.8
LWP 5.823
WWW::Mechanize 1.54
WWW::Mechanize::Cached 1.32
HTTP::Response 5.820
If I attempt to serialize an HTTP::Response, I get an error because
storeable can't serialize a code reference.
This occurs when 'content-encoding' => 'gzip'
Since this causes a CODE reference in the object.
The reason why I'm reporting this to mechanize is that the
HTTP::Response object makes no guarantees that it can be easily serialized.
Whereas the Cached program does.
It's pretty easy to do this:
use Safe;
my $safe = new Safe;
$safe->permit(qw(:default require));
local $Storable::Deparse = 1;
local $Storable::Eval = sub { $safe->reval($_[0]) };
But it's really something that the Cached program should do... probably
it would be cool to
a) do it on demand
b) permit the bare minimum of routines
I added Eval and Deparse methods and determined that the CODE is this:
sub {
package LWP::UserAgent;
use strict 'refs';
return unless $parser;
undef $parser unless $parser->parse($_[3]);
}
Really a silly bit of code to put in a code ref. Maybe the response
object people should fix.