And remember that you have to manually force the warnings to be output by calling
warningsToBrowser(1); - in the simplest case, just do it before the script exits, so you get a cumulative list of all the warnings as a neat list of HTML comments at the bottom of the CGI generated page.
Makeshifts last the longest.