Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the WWW-Mechanize-Cached CPAN distribution.

Report information
The Basics
Id: 42692
Status: resolved
Priority: 0/
Queue: WWW-Mechanize-Cached

People
Owner: olaf [...] wundersolutions.com
Requestors: EARONESTY [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 1.32
Fixed in: (no value)



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.
From: olaf [...] wundersolutions.com
On Thu Jan 22 19:14:16 2009, EARONESTY wrote: Show quoted text
> 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. Show quoted text
> > 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.
Hi, Thanks for your input. I just took over maintenance of this module last night and uploaded a newer version with some bug fixes. Some of the CODE reference issues should now be resolved with the 1.33, which is now on CPAN. There's also a copy of the code up on github: http://github.com/oalders/www-mechanize-cached/tree/master Can you let me know if this is still an issue for you? If so, please feel free to fork and patch the code via github and let me know. Thanks, Olaf
Hi, Thanks for your input. I just took over maintenance of this module last night and uploaded a newer version with some bug fixes. Some of the CODE reference issues should now be resolved with the 1.33, which is now on CPAN. There's also a copy of the code up on github: http://github.com/oalders/www-mechanize-cached/tree/master Can you let me know if this is still an issue for you? If so, please feel free to fork and patch the code via github and let me know. Thanks, Olaf
This issue has been resolved in version 1.33