Your original code was fine. The CGI object is only being created when there is an actual error and carp_error() is called. This isn't happening on every page load (or it isn't *supposed* to anyway). I think you're in more trouble by assigning to the global $q instead of the function lexical $q since *then* you have to think about whether it is staying around or not.
All in all - you're overworking yourself here. Its ok, really. Now if only I could find my lost dog I'd be happy.
In reply to Re: Proper use of CGI::Carp together with CGI.pm
by diotalevi
in thread Proper use of CGI::Carp together with CGI.pm
by davido
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |