$logger->debug(sub { "large data structure is: ".Dumper( expensive_calculation($foo) ) });
This ensures that expensive_calculation() is not performed unless the log level is DEBUG or below.
A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.