in reply to Proper use of CGI::Carp together with CGI.pm
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.
|
|---|