I wouldn't bother doing the check first, I just change the code to:
$logger->error(sub {"Erroneous array: @super_long_array"});
then I believe it does not get expanded until inside Log::Log4perl when it decides to log or not.
So now all you need is a Perl Critic rule for using sub {} in logging ;-)
In reply to Re: Perl::Critic policy for common Log::Log4perl mistake
by mje
in thread Perl::Critic policy for common Log::Log4perl mistake
by andreas1234567
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |