in reply to Why does this crash? (Error 500)

If you are running a script as a cron job, why are you including the CGI module?

Try reading man 5 cron.

Include a line in cron:

MAILTO=you@yourdomain,com

and cron will mail you all error messages, printouts, ,and other output from your scripts.

--
TTTATCGGTCGTTATATAGATGTTTGCA