Hi,

thanks for response and yes, I'm sorry - wasn't specific enough....

Another try. I have command line utility that communicates with central software router under LMCE system. Whatever script receives from router it sends to stdout and whatever it receives on stdin, will be sent to router.

Therefore I need to have two way communication with that script from my Perl app.

Here is the code I'm trying, but get nothing (utility works from command line - it sends string to stdout) :
#! /usr/bin/perl use warnings; use strict; use IPC::Open2; my $pid = open2 my $out, my $in, "/usr/pluto/bin/DCE-Whisperer -d 38 - +r 192.168.0.51"; die "$0: open2: $!" unless defined $pid; #print $in "PING"; my $sum=undef; while (1) { $sum = <$out>; if ($sum) { print ("Got from DCERouter(out): $sum\n") ; print $in "reply txt OK\n"; $sum=undef; }; } ; close $in or warn "$0: close: $!"; close $out or warn "$0: close: $!";


Thanks in advance for any help...

regards,

Rob.

In reply to Re^2: Communicate with child process via stdin, stdout by Anonymous Monk
in thread Communicate with child process via stdin, stdout by Anonymous Monk

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.