On Jul 1, 2005, at 10:43 AM, Cees Hek wrote:
On 7/1/05, Mark Stosberg <suppressed> wrote:# If something goes wrong, make sure to stop the HTTP server. sub cleanup { kill(9,$pid) } $SIG{__DIE__}=\&cleanup;Would it be better to put this in an END block? I'm not sure if this signal gets thrown at a normal exit. I use END blocks in test scripts for stuff like this and they work well.Also, is a kill 9 really necesary? It seems a little overkill (pun intended :D). kill 9 should only be done as a last resort if the process will not die on it's own.
Generally yes I do stay away from a 9. Weapon of last resort. I started using the 9 when I writing the CGI tests for HTTP::Server::Simple. As with the developers before me there were rare occasions when it was required, and rather than accidently leaving a process running from a test, it was safer to brute force it to die and be sure. I made this decision for my tests. YMMV.
-Shawn
---
Shawn Sorichetti
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/suppressed/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.