Re: [PBML] Exit command
>>>>> "Sreeram" == Sreeram B S <sreeramabsc@...> writes:Sreeram> Thus, we have to use this in the script:
Sreeram> `kill -9 $PID`; where $PID is the process-ID of the terminal..
This is wrong for so many reasons:
(1) don't use `` in a void context. use system()
(2) you didn't need to shell out anyway, since kill() is a Perl built-in!
(3) don't send signal 9 to a process as the first signal. it gives the process
no chance to clean up.
So, replace that junk with something like:
kill 15, $PID;
Faster, better, cheaper.
So, wherever you got that answer from, I'd distrust that source a bit
more. If that was your brain, please learn a bit more before you
answer other questions.
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!