in reply to Re^5: Executing functions from another process
in thread Executing functions from another process
That's exactly the point I was glossing over when I recommended a dispatch table at the receiving end, and a JSON producer at the sending end..
The OP doesn't have to use JSON, but it's convenient, and well understood. The point is that the OP cannot simply pass references around, he has to pass plain old data. So a JSON packet that looks something like this:
'{"action":"tupitar","params":["this","that","other"]}'
...would be easy to interpret at the receiving end. And the dispatch table avoids the mess of going directly to symbolic subrefs.
Things get ugly if he's got to send huge amounts of data to the subroutines. But even there, an additional layer of indirection can help; instead of sending data as a parameter, send a link to the data; a filename, a row ID from a database, or whatever. But sending a Perl reference is an indirection that will lose its magic as it gets passed around. ...just like you wouldn't pass a C pointer to local data from one process to another.
Dave
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^7: Executing functions from another process
by gri6507 (Deacon) on Jan 24, 2014 at 15:09 UTC | |
by BrowserUk (Patriarch) on Jan 24, 2014 at 15:37 UTC | |
by gri6507 (Deacon) on Jan 24, 2014 at 15:46 UTC | |
by BrowserUk (Patriarch) on Jan 24, 2014 at 16:29 UTC | |
by Corion (Patriarch) on Jan 24, 2014 at 16:41 UTC | |
|