use Try::Tiny; use Log::Log4perl qw(get_logger :levels); Log::Log4perl->init_and_watch('/etc/log4.conf', 60); my $log = get_logger('Q::S'); fred(); sub fred { my $x = try { dave(); 0; } catch { my $ev = $_; if (0) { eval { my $a = 1; 1; } or $log->warn("failed $@"); } else { $log->logwarn("test $_"); } 1; }; print "$x\n"; return if $x; # <---- this would be q.pl line 1895 } sub dave { # the following line would be DB.pm line 1380 my ($sth, $options, @args) = @_; }