in reply to cgi code line message
In the error_message() routine, use the caller() function to figure out who called you from where. See the perlfunc entry for examples.