Skip Menu |
 

This queue is for tickets about the URI CPAN distribution.

Report information
The Basics
Id: 3904
Status: resolved
Priority: 0/
Queue: URI

People
Owner: Nobody in particular
Requestors: talby [...] trap.mtview.ca.us
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.25
Fixed in: (no value)

Attachments
URI-1.25-storablefix.patch



MIME-Version: 1.0
X-Mailer: MIME-tools 5.405 (Entity 5.404)
Subject: odd interaction with Storable
Content-Type: multipart/mixed; boundary="----------=_1064885446-12449-0"
Content-Length: 0
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: iso-8859-1
Content-Length: 947
Download (untitled) / with headers
text/plain 947b
Perl version: v5.8.0 built for i386-linux-thread-multi URI version: 1.25 on Linux 2.4.22, Debian testing dist The script at the end of this message gives me an error: Cannot restore overloading on SCALAR(0x821ed94) (package URI::http) at ../../lib/Storable.pm (autosplit into ../../lib/auto/Storable/_retrieve.al) line 323, at ack.pl line 15 unless I add a STORABLE_freeze and STORABLE_thaw handler for the underlying URI::* objects. I have attached a patch to URI::_query that appears to allow objects that contain URI objects to be Storable serialized. It's likely not the ideal way to fix this problem, but appears to do the job reliably. #!/usr/bin/perl use strict; use warnings; if($ARGV[0] eq 's') { use URI; use Storable; my $a = { u => new URI('http://search.cpan.org/'), }; store $a, 'data.dat'; } else { use Storable; use Data::Dumper; my $a = retrieve 'data.dat'; print Dumper([$a]); }
Content-Type: application/octet-stream; name="URI-1.25-storablefix.patch"
Content-Disposition: inline; filename="URI-1.25-storablefix.patch"
Content-Transfer-Encoding: base64
Content-Length: 420
diff -Naur URI-1.25/URI/_query.pm URI-1.25fix/URI/_query.pm --- URI-1.25/URI/_query.pm 2003-08-05 07:22:03.000000000 -0700 +++ URI-1.25fix/URI/_query.pm 2003-09-29 18:15:37.000000000 -0700 @@ -67,4 +67,13 @@ # Some URI::URL compatibility stuff *equery = \&query; +sub STORABLE_freeze { + my($self, $cloning) = @_; + return $$self; +} +sub STORABLE_thaw { + my($self, $clonging, $str) = @_; + $$self = $str; +} + 1;


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.