in reply to Portable Process Control

This progam starts another prog and reads from its STDOUT. The other prog just prints hi there in an infinite loop.

#!/usr/bin/perl -w open (PIPE,"printsth |") or die $!; while(<PIPE>) {print; last if $i++ >=1000; } close(PIPE) or die "Quit with exit status: $? message: $!" ;
#prog printsth #!/usr/bin/perl -w print "hi there", $/ while(1);

When i run my first scirpt it (close) terminates the pipe but fails for some reason. However i don't see my program opened through the script running in the system so it has been forced to terminate somehow

hi there .... .... hi there hi there Quit with exit status: 13 message: at termpipe line 7.