Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

How to use perl objects located on another machine?

by vonman (Acolyte)
on Feb 13, 2002 at 17:26 UTC ( [id://145213]=perlquestion: print w/replies, xml ) Need Help??

vonman has asked for the wisdom of the Perl Monks concerning the following question:

I need to instantiate a perl object (we'll call it foo here) that is located on another machine. Originally I wanted to install Apache onto the other machine and call foo from a CGI program. Unfortunately we will not be able to install Apache on that machine. I need to hear from you what is the best way to access foo from my primary machine. One option that I am considering is to NFS mount the directory that has foo onto my machine? Any suggestions or options will be greatly appreciated? Thanks in advance!!
  • Comment on How to use perl objects located on another machine?

Replies are listed 'Best First'.
Re: How to use perl objects located on another machine?
by traveler (Parson) on Feb 13, 2002 at 18:15 UTC
    If you want to execute the code that exists on the other machine, consider SOAP. Briefly, SOAP is a remote procedure call (RPC) mechanism that serializes your function call and sends it over the net. It is language independent. It uses XML to specify the data (args and return) and usually HTTP to make the data transfer. You don't need to know XML to use it. There is a perl module SOAP::Lite to make it easy along with lots of other SOAP modules.

    HTH, --traveler

Re: How to use perl objects located on another machine?
by perrin (Chancellor) on Feb 13, 2002 at 18:04 UTC
    Well, what's your goal? Do you want to just execute this code (in which case, just copy it your machine and run it) or do you want to execute it on the other machine? If it's the latter, NFS won't do it. CGI was a very good idea, but failing that you can use one of the other RPC mechanisms for Perl, like PlRPC.
Re: How to use perl objects located on another machine?
by dhable (Monk) on Feb 13, 2002 at 18:30 UTC
    In addition to SOAP and RPC, you could always use CORBA to run the object on the other machine. Check out the ORB package for more details. Given the complexity of CORBA, I would tend to avoid it unless it's a company standard or you have CORBA resources in house.

      I've had good success with the COPE language binding, however you'll still need an ORB to go with it, for instance ORBacus, which is free for non-commercial use, but requires a license for use in a business. I'd say use CORBA if you require a significant amount of interaction with the remote object. That is, if you're doing more than just firing it up and letting it go. CORBA is much too heavyweight otherwise.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://145213]
Approved by root
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-14 11:36 GMT
Find Nodes?
    Voting Booth?

    No recent polls found