I have written a perl module to interface to a cli ui. Here
is a snippet of code from the module
use IPC::Open2;
use Symbol;
sub connect_to_cli {
my $rdr = gensym();
my $wtr = gensym();
my $pid = open2( $rdr, $wtr, $cmdline );
return $pid;
}
And from a script that uses that module
use MyModule;
my $session = new MyModule();
$pid = $session->connect_to_cli();
Running the perl script causes things to get stuck on the open2
call. But if I use the open2 call in a perl script it works fine.
use IPC::Open2;
use Symbol;
my $rdr = gensym();
my $wtr = gensym();
my $pid = open2( $rdr, $wtr, $cmdline );
print "pid = $pid\n";
Soraia
Edit by tye
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.