Here is a performance tip for you:
use constant DEBUG => 1;
print "this is debug" if DEBUG;
While this is all well and fine, it can't be changed in run-time.
Log::Log4perl has a mechanism
is_level that allows for reasonably high performance while allowing configuration changes in run-time (
init_and_watch).
$logger->debug("Erroneous array: @super_long_array")
if($logger->is_debug());
Benchmark your code and see if you can live with the penalty. Performance is not everything.
--
No matter how great and destructive your problems may seem now, remember, you've probably only seen the tip of them. [1]