Your next best friend is warn - if something goes weird, but not enough to kill the script, you can have your script warn "Something's not right, at line " . __LINE__ . " in file " . __FILE__;, and include any other debugging information. This all gets sent to STRERR, which if you are running as a cronjob, will be sent via mail or other options to the user that that job belongs to.
Dr. Michael K. Neylon - mneylon-pm@masemware.com
||
"You've left the lens cap of your mind on again, Pinky" - The Brain