#!/usr/bin/perl -- use strict; use warnings; use Capture::Tiny qw/ capture /; my @cmd = ( "$Bin/$get_version_prog", $filer ); my( $stdout, $stderr, $exit ) = capture { system { $cmd[0] } @cmd; };; $exit and die "it failed with $exit and $stderr ";