use Log::Log4perl qw(:easy); Log::Log4perl->easy_init($ERROR); use Capture::Tiny 0.12 qw( capture_stderr ); my $errors = capture_stderr{ system( 'warn.pl' );# Your favorite system call here }; map{ ERROR $_ } split "\n", $errors;