:) Really, you don't have /dev/null on windows?
Use File::Spec->devnull
naturally fixing those portability issues , select loop is forever
use File::Spec();
sub launch {
my ($id) = @_;
open(local *TO_CHILD, '<', File::Spec->devnull ) or die $!;
*TO_CHILD if 0;
my $pid = open3(
'<&TO_CHILD',
my $from_child = gensym(),
'>&STDERR',
#~ perl => ( -e => 'use Time::HiRes qw( sleep ); $|=1; for (1..r
+and(10)+5) { sleep(0.100 + rand(100)/1000); print "a" }' ),
$^X => ( -e => 'use Time::HiRes qw( sleep ); $|=1; for (1..rand(
+10)+5) { sleep(0.100 + rand(100)/1000); print q{a} }' ),
);
return { id => $id, pid => $pid, pipe => $from_child, buf => '' };
}
Perl version: v5.14.1 on MSWin32
Carp - 1.26
Devel::VersionDump - 0.02
Exporter - 5.66
File::Spec - 3.33
File::Spec::Unix - 3.33
File::Spec::Win32 - 3.33
IO::Select - 1.20
IPC::Open3 - 1.09
Symbol - 1.07
constant - 1.21
strict - 1.04
vars - 1.02
warnings - 1.12
warnings::register - 1.02
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|