use Capture::Tiny qw(capture); my ($stdout, $stderr, $exit_code) = capture { system('htmldate', '-u', $url) };