I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2009-09-15 15:05:13-07 by jerome
Retrieving or thawing arbitrary OIO-based classes

I am trying to send OIO objects through IPC between processes on two different hosts. I have not been able to do so unless the receiving process has a proper 'use' statement for the package of the object being received. This prevents me from being able to send and receive "arbitrary" objects, i.e objects of a class not known at compile time by the receiving process. I have included a simple example below that does not rely on IPC but exhibits the same behavior (for what I believe are the same reasons).

Put in Foo.pm
package Foo;{ use strict; use warnings; use Object::InsideOut qw(Storable); my @bar :Field :Arg(Name=>'bar', Mandatory=>1); } 1;
Put in unload.pl
use strict; use warnings; use lib '.'; use Foo; my $file = 'object.stor'; my $object = Foo->new( bar => 10 ); $object->store($file);
Put in load.pl
use strict; use warnings; use Storable qw(retrieve); my $file = 'object.stor'; my $object = retrieve($file);

Run unload.pl and then load.pl. You should see this error: OIO::Args error: Unknown field name for class 'Foo': bar Package: Storable File: blib/lib/Storable.pm (autosplit into blib/lib/auto/Storable/_retrieve.al) Line: 331 Does this make sense? Is there any way to accomplish this? Jerome

Direct Responses: 11449 | Write a response