Hi
am using Perl 5.8.0 on RH-9 box (kernel 2.4.20.x)
I have this command
/home/me/myProgram |perl myPscript.pl >/tmp/log-file &
which runs fine when run from command prompt.
Purpose of myPscript.pl is to detect EOF condition and exit on it.
So, when /home/me/myProgram is killed, myPscript.pl detects it and
exits gracefully.
But problem starts when
I run the above command as :
rsh anotherBox "/home/me/myOtherProgram |perl myPscript.pl
( Here myOtherProgram is a threaded (POSIX) program and it creates 2
threads when running )
then I logon to anotherBox and manually kill myProgram's main thread (
When main dies, child threads also dies ) so that EOF is send to my
perl script.
But I noticed that the moment I kill main thread, perl starts taking
99.9 of cpu
and doesnt die. It is looking for some resource but what ?
any clue ?
perl script :
-----------------------------------------
while (<>) {
push @buffer;
}
print @buffer;
-------------------------------------------------