in reply to Is "states" a reserved hash name??
Check out CGI::Carp. use CGI::Carp qw[fatalsToBrowser] will send all fatal errors to the browser in a fairly nice format to look at.
Hope this helps!