, i've been following this node very closely. you can see by my replies that i have been trying to solve a similar issue. i was never satisfied with my implementation... mostly due to tilly
's constant, nagging reminders to use select
well, i did a little investigation on select, and i found some interesting things you'll appreciate. for instance, select is only implemented on sockets in Win32. hrmm. also, open2/open3 cannot redirect input/output in a child process via fork in Win32. i'm afraid a lot of the code you have there is not doing anything useful.
here's a list of links for more information:
IO::Select on Windows
stdin-socket without fork()??
here's a test script to verify select is in fact, not working. can_write, can_read, and has_exception all come back undef on Win32... (see below)
# create typeglobs and add to selector
$output_select = IO::Select->new( *CMD_ERR, *CMD_OUT, *CMD_IN );
# test selector methods
$cnt = $output_select->count();
print "count: $cnt\n";
@bob = $output_select->handles();
print "list: @bob\n";
@bob = $output_select->can_write(10);
print "write: @bob\n";
@bob = $output_select->can_read(10);
print "read: @bob\n";
@bob = $output_select->has_exception(10);
print "exception: @bob\n";
i'm now working on a client / server solution for executing external programs and redirecting output using sockets. as soon as i have something solid, i'll be sure to post it, and /msg you with the node_id.
thank you for using microsoft ;-D
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
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:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||