in reply to IPC:Open2 question

When I start the script it starts the program and, but does not output anything. Only when I kill the process of the external program through the windows task manager, the (correct) output is printed to the screen. Do I somehow have to end the process in the script? When I run the program just from the command line with input on standard input, it prints it's results and exits.

I've encountered similar situations when playing around with IPC. It sounds to me like you need to somehow "flush" the pipe which IPC2 sets up for <README>. I'm no expert, I usually just "hack at it" until I get results. As a guess, I would say the local $/ = undef; statement may be interfering with IPC2 's ability to detect a newline? (which signals a pipe flush?)

I know with sockets, earlier version of IO::Socket did not have autoflushing turned on, and you needed to manually issue a $sock->flush to avoid the problem you describe.

If the program you are running is a perl script, you should be able to make it flush, but if it's not a script...then you may have to get "low-level" with it.

You can "suck data" out of the pipe, if you know how much data is waiting in the pipe Read "perldoc -q filehandle" there is a section on it:

#read man h2ph if you don't have sys/ioctl.ph require 'sys/ioctl.ph'; $size = pack("L", 0); ioctl(FH, FIONREAD(), $size) or die "Couldn't call ioctl +: $!\n"; $size = unpack("L", $size);
So you can keep running this test, and when $size > 0, you can use sysread to grab a $size chunk out of the filehandle.

I'm not really a human, but I play one on earth. flash japh