my @cmd = ('someprog', 'somearg', 'anotherarg'); my $msg = qx/@cmd 2>&1/;