Subject: | FreezeThaw support seems broken (at least in ClientLite) |
Perl 5.8.8, on Debian; IKC installed via CPAN.
FreezeThaw does not work, at least not with ClientLite.
I have not tested it with POE::Compenent::IKC::Client yet.
What works perfectly with Storable, does not work when using FreezeThaw:
use POE::Component::IKC::ClientLite;
my $poe = create_ikc_client(
port => 6666,
serialiser => 'FreezeThaw' );
my $ret = $poe->post_respond("Service/event", {Hi=>"There"});
...
I get this error:
Error: Can't use string ("1") as a HASH ref while "strict refs" in use
at /home/faiz/perl/lib/POE/Component/IKC/ClientLite.pm line 376, <GEN0>
line 7.
It seems that FreezeThaw's thaw subroutine returns it's result as a list
(instead of a reference), leading the the code in ClientLite.pm:276 to
evaluate it as '1'.
The attached patch seems to fix it, and does not appear to break the
other serializers (or "serializers"), such as Storable.
Subject: | ClientLite-FreezeThaw-fix.patch |
--- /usr/local/share/perl/5.8.8/POE/Component/IKC/ClientLite.pm.orig 2007-11-01 16:49:10.000000000 +0900
+++ /usr/local/share/perl/5.8.8/POE/Component/IKC/ClientLite.pm 2007-11-01 16:49:20.000000000 +0900
@@ -372,7 +372,7 @@
$frozen=substr($raw, 0, $need); # seems so...
substr($raw, 0, $need)='';
- my $msg=$self->{remote}{thaw}->($frozen); # thaw the message
+ my ($msg)=$self->{remote}{thaw}->($frozen); # thaw the message
my $to=specifier_parse($msg->{event});
DEBUG && print Dumper $msg;