if ($SIG{PIPE}==1) { $dbh->disconnect(); foreach my $jpeg_file (glob("/usr/local/apache2/htdocs/images/graphs/*.jpeg")) { unlink("$jpeg_file") } foreach my $csv_file (glob("/usr/local/apache2/cgi-bin/output/*.csv")) { unlink("$csv_file") } foreach my $zip_file (glob("/usr/local/apache2/cgi-bin/output/*.zip")) { unlink("$zip_file") } exit(0); }