Skip Menu |

This queue is for tickets about the URI CPAN distribution.

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

Owner: Nobody in particular
Requestors: talby [...]

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


Subject: odd interaction with Storable
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/ (autosplit into ../../lib/auto/Storable/ line 323, at 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(''), }; store $a, 'data.dat'; } else { use Storable; use Data::Dumper; my $a = retrieve 'data.dat'; print Dumper([$a]); }
diff -Naur URI-1.25/URI/ URI-1.25fix/URI/ --- URI-1.25/URI/ 2003-08-05 07:22:03.000000000 -0700 +++ URI-1.25fix/URI/ 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 infrastructure.

Please report any issues with to