sub ErrorOut { ########################################################################################## # # This subroutine write all STDERR to the log file and deletes the Lock File. # ########################################################################################## my $error = shift; print "$error\n"; # # Delete the Lock File # if (-e $lock_file) { if (unlink($lock_file) == 1) { print "Lock File $lock_file deleted successfully.\n\n"; } else { print "Lock File $lock_file could not be deleted.\nEnsure the UID running this program has proper permissions\n"; # exit 1; } } # exit 1; } # End sub ErrorOut