$SIG{PIPE} = \&broken_pipe; [...] sub broken_pipe { #open(LOG, ">>log/Error.log") or die "Cant open Log $! \n"; print LOG " BROKEN!!!! \n"; close (LOG); die "Broken ... \n"; #$dbh->disconnect(); #open(LOG, ">>log/Error.log"); print LOG "Broken \n"; close(LOG); #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); }