>> You can serialize/deserilize object with Storable
>> 
>> $foo = new Bar
>> store_fd $foo, \*SOCKET;
>> 
>> and on the other end
>> 
>> $foo = retrieve_fd \*SOCKET;
>> $foo->bar;
>> 
>> It will work if you have Bar module on both ends.

DS> Right, but I want it to work if you don't...

Then maybe SOAP::Lite? SOAP allows to serialize/deserialize objects
and make remote call. SOAP::Lite makes it quite transparent.

server part (which has module Bar):

    use SOAP::Transport::HTTP;

    SOAP::Transport::HTTP::CGI
        -> dispatch_to(qw(Bar))
        -> handle;

    package Bar;

    sub get_bar { new Bar };

    sub new { ... };

    sub bar { ... };

client part:

    use SOAP::Lite +autodispatch =>
        uri => 'http://www.host.com/Bar',
        proxy => 'http://www.host.com/cgi-bin/server.pl';

   my $foo = Bar->get_bar;
   $foo->bar;

Another solution is module Class::Tom. I've not tried it so check it
yourself: http://search.cpan.org/doc/JDUNCAN/Class-Tom-3.02/Tom.pm.

-- 
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/)                                    |
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80  E4AE BE1A 53EB 323B DEE6 |
| AGAVA Software Company (http://www.agava.com/)                          |
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to