Monks,

What is the current "preferred" way to do RPC calls to a different machine with Perl? Is SOAP still the main option?

A few years ago I was using a hand-rolled method of remote procedure calls. It involved Storable and some http requests. Oh, by the way, it sucked. Lots of AUTOLOAD and fiddling with @INC lead to code that was difficult to debug and maintain.

However, it did mean that code like the following would work whether the modules it used and the methods it called were "local" or "remote":

use My::Module; my $obj = My::Module->new( %args ); foreach my $item ( $obj->foo_items ) { $item->do_it; }# end foreach()

At the time we were using Class::DBI for a database ORM. A "stub" base-class on the "client" machines would handle the requests and responses, allowing us to use the same class names on the "client" machines as we did on the remote machine. This worked out very well, but because of the statelessness of http, we could not use database transactions. We used $Data::Dumper::Deparse semantics to serialize a coderef containing the transaction code, and then execute via eval($str) on the remote server. Again - this worked, but it was difficult to debug and maintain.

I wonder how this might work out a bit better at this time - with Moose now and with Perl6 arriving soon.


In reply to Preferred RPC method? by jdrago_999

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.