http://qs321.pair.com?node_id=362498

goofball has asked for the wisdom of the Perl Monks concerning the following question:

When a CGI script is right in the middle printing output to the browser and you hit "stop" or "cancel" on the browser, the script obviously stops running.

Is there a way to detect when this happens?
(Using an END block doesn't seem to work).

I have a script that creates a temporary zip file based on parameters passed to the script, then serves the file, then deletes it. If the script gets cancelled from the browser half-way through, the temporary zip file doesn't get deleted and sits there hogging disk space.

Any help is appreciated! Thanks!