http://www.perlmonks.org?node_id=545478


in reply to Re^3: Running external command from perl but cannot capture output
in thread Running external command from perl but cannot capture output

In
@test=`mac \"$_\" -v >/dev/null 2>&1`;
stdout is directed to /dev/null, and then, stderr is directed to where stdout points to. So this one should work:
@test=`mac \"$_\" -v 2>&1`;
BTW, to check the exit status instead of capturing the output, you can use system() instead of `` or qx//