#!/usr/bin/perl use strict; select(STDIN);$| = 1; select(STDOUT);$| = 1; print STDERR "starting interaction\n"; $! = ''; print "GET /\n\n"; print STDERR "printerr is $! " . fileno(STDIN) . ", " . fileno(STDOUT) . "\n"; print STDERR "req sent\n"; $! = ''; while () { my $v = $_; print STDERR "readerr is $!\n"; print STDERR $v; } print STDERR "readerr is $!\n"; print STDERR "done interaction\n"; ----------- I tried several versions of servers, and all behave the same: #------version1 - works fine on linux #!/usr/bin/perl use strict; use IO::Socket; my $conn = IO::Socket::INET->new( Proto => "tcp", PeerAddr => "192.168.0.12", #change to any hostname PeerPort => 80, ) || die("can't connect"); open(STDIN,"<&" . $conn->fileno); open(STDOUT,">&" . $conn->fileno); system("$^X testfile-slave.pl"); print STDERR "done\n"; -------------------- #---------version2 - windows-specific #!/usr/bin/perl #use strict; use IO::Socket; my $conn = IO::Socket::INET->new( Proto => "tcp", PeerAddr => "192.168.0.12", #use address of any web server here PeerPort => 80) || die("can't connect"); binmode($conn); open(STDIN,"<&" . $conn->fileno) || print STDERR "can't redir stdin\n"; open(STDOUT,">&" . $conn->fileno) || print STDERR "can't redir stdout\n"; my $file = "testfile-slave.pl"; use Win32::Process; use Win32; my ($ProcessObj,$exitcode); if (Win32::Process::Create($ProcessObj, "$^X","$^X $file", 1, NORMAL_PRIORITY_CLASS,".")) { $ProcessObj->Wait(500000); $ProcessObj->Kill($exitcode); } else { print STDERR "failed executing $file\n"; }; print STDERR "done\n"; --------------------