in reply to cleanup a cancelled CGI script

This will probably not apply directly to your problem as it refers to mod_perl but it is an interesting read nonetheless.

jayrom