Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

runrig (3385)

runrig
  dougwNO@SPAMcpan.org

Just another perl hacker somewhere near Disneyland

I have this homenode [perlmonks.org] of little consequence on Perl Monks [perlmonks.org] that you probably have no interest in whatsoever.

I also have some modules [cpan.org] on CPAN [cpan.org] some of which are marginally [cpan.org] more [cpan.org] useful [cpan.org] than others.

Journal of runrig (3385)

Friday October 06, 2006
12:02 PM

Stupid windows fork

[ #31242 ]
After looking at Abigail's post I wanted to write a stupid test program to attempt to confirm my assumptions, and started with this:

my $pid = open(my $fh, "yes|") or die "Acck: $!";
my $i;
while (<$fh>) {
  print;
  last if ++$i > 10;
}
print "Closing\n";
close $fh or die "Acck: $!";
print "Done!\n";

This works fine on Unix, and I have unix utilities installed on Windows, so I tried it there, and it gets hung up closing the file handle. If you ctrl-C out, 'yes' is left running in the shell, chewing up resources. I found out after running this a few times, and noticing that my PC was making "I'm working really hard" type noises. 'exit' at the cmd shell prompt gets hung up also, and the yes processes don't go away until you kill the shell window (by clicking the "please die" red X).

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.