use Log::Painless { level => 'debug' }; sub test_log { debug enter; # puts 'Entered subroutine main::test_log' to log eval { # .. something which could die.. }; if ($@) { # logs 'Caught exception [$@] 1 evals deep in main::test_log' info caught; # .. handle the exception } debug leave; # as enter, above, but "Left subroutine" } test_log();