This turned into a long discussion in the Chatterbox so SoPW seemed like the next logical step in my pursuit for enlightenment.

I've written a Perl program that sits in a while() loop doing a few tasks, one of which is polling the serial port for data. When data is received the program does some control calls to a win32 application via OLE.

Now I'm looking for a way to pass data(a simple string) back to my Perl program. Any ideas?

One of the issues is that the solution needs to be "non-blocking" since my program needs to continue polling the serial port and lives in a single threaded world.

The win32 app has the ability to run PerlScript via the ActiveX engine, so one solution I thought might work would be to spawn a thread in my Perl app that opened a tcp socket and listened. The win32 app would then run a PerlScript that connected to the socket and passed the string. In turn, the child would then pass the string to the parent. Unfortunately I do not see a way to get the child thread to communicate with the parent.

So, what is the best solution to pass data to a running Perl process in the Win32 environment?

-Nitrox


In reply to Inter-Process Communication by Nitrox

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.