CC: | sysmonblog [...] googlemail.com |
Subject: | Calling Storable::store with an HTTP::Response object fails. |
I have some code that tries to cache, via Storable, the HTTP::Response
object returned by LWP::UserAgent->get
If a later call returns a 304, my code still wants to know what the
original (and currently not modified) content/response was. Caching the
HTTP::Response object achieved this, and worked fine under perl 5.8 on
ubuntu intrepid.
It breaks under 5.10 on ubuntu jaunty. I've attached a little script
that reproduces the problem. In short, it's the CODE block in the
HTTP::Response->{handlers}->{response_data} that Storable cannot handle.
I'm willing to work on a failing test case, and potentially try putting
a patch together, however I'm not clear IF this would be considered a bug?
Is it sane to want to call Storable on an HTTP::Response object?
If it is, I'm not sure what a suitable fix would be. For my uses, I
already have the content, so I know I won't want to call the
response_data callback in the future. So simply removing the callback
handler suffices. However that won't work in general.
LWP::UserAgent has a remove_handlers() method, but I don't see anything
similar in HTTP::Response (or HTTP::Message) that would allow me to work
around this in my code.
If someone could point me at how it ought to be solved, I will try to
code it in a patch.
Subject: | storable_http_response |
Message body not shown because it is not plain text.