Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^3: Does IO::Select work? Anywhere?

by Anonymous Monk
on Oct 21, 2012 at 10:30 UTC ( #1000194=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Does IO::Select work? Anywhere?
in thread Does IO::Select work? Anywhere?

:) 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


Comment on Re^3: Does IO::Select work? Anywhere?
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1000194]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2015-07-06 04:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (70 votes), past polls