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

I have just started learning PERL and want to know how two mutually exclusive PERL programs can communicate by sending signals to each other.

Replies are listed 'Best First'.
Re: how do two PERL programs communicate?
by gaal (Parson) on Nov 03, 2006 at 11:25 UTC
    How do two different programs written in other languages communicate with each other?

    You will probably find perlipc useful.

Re: how do two PERL programs communicate?
by Velaki (Chaplain) on Nov 03, 2006 at 11:26 UTC

    There are a multitude of ways in which two Perl programs may communicate with one another. I think you'll find a read-though of perlipc to be most helpful, as well as perusing the standard books.

    Hope this helped,
    -v.

    "Perl. There is no substitute."
Re: how do two PERL programs communicate?
by zentara (Cardinal) on Nov 03, 2006 at 13:54 UTC
    Basically you have pipes, sockets, shared thread variables, or shared memory. Shared Memory is the fastest, but most difficult. Sockets are probably the most reliable and well tested.

    I'm not really a human, but I play one on earth. Cogito ergo sum a bum
Re: how do two PERL programs communicate?
by fmerges (Chaplain) on Nov 03, 2006 at 14:20 UTC

    Hi,

    I think is also worth to mention ways to communicate over sockets like XML-RPC, SOAP, Jabber, CORBA, BEEP, and a large of etceteras ;-)

    Regards,

    fmerges at irc.freenode.net

      You want the perl scripts to send oneanother jabber messages when they complete their tasks?

      mailer.pl> i'm done, over to you

      backend.pl> Ok, great, i'll start on that

      mailer.pl> let me know when you're done.

      backend> Sure, will do ^_^

      Hrm, I smell botnet

      will: do{ perl programming } for $cash;

        Hi,

        I see you don't have any idea of what Jabber really is!

        XMPP is a set of protocols expressed within XML. XMPP provides a structured, extensible framework for exchanging all kinds of information. It provides you with Synchronous, Request/Response, and also Asynchronous Framework. It has Component/Service Architecture. As XML-RPC and SOAP are also XML based, RPC can go through XMPP messages, getting all the benefits that the Jabber server and the XMPP protocols can provide.

        And you can also define your own protocol, because there are only a few restricted tags that Jabber uses itself, so there is space for defining something that only process your business logic.

        So, I recommend you doing a research first and then write comments...

        Ahh, there're also nice books about Jabber, for example:

        Regards,

        fmerges at irc.freenode.net
        OK, not helpful, i get the point.
Re: how do two PERL programs communicate?
by graff (Chancellor) on Nov 03, 2006 at 14:10 UTC
    I would be curious to understand what it means for two Perl programs to be "mutually exclusive". But that's probably not relevant here...
Re: how do two PERL programs communicate?
by tinita (Parson) on Nov 03, 2006 at 18:39 UTC
Re: how do two PERL programs communicate?
by cLive ;-) (Prior) on Nov 03, 2006 at 18:13 UTC
    IPC::Open3::Simple is my new favourite. Though the method you use will depend on how and when these scripts want to talk to each other. Not enough context to suggest an optimal solution.
Re: how do two PERL programs communicate?
by j3 (Friar) on Nov 05, 2006 at 23:54 UTC
    {snip} how two mutually exclusive PERL programs can communicate by sending signals to each other.

    Although you probably meant "signals" in the standard Unixy sense, in the more generic sense (and if the Perl programs are running on different machines, and if they don't need to talk to each other very often), I've seen email messages used for inter-app communication -- and it didn't work too badly either. :)

    Granted, it's not optimal, and there's often better solutions out there, but it's a hack I've seen done.

A reply falls below the community's threshold of quality. You may see it by logging in.