$command = "(do this && do that) >/dev/null 2>&1"; #### close STDOUT; open STDOUT, '>', \$variable; system( $command ); close STDOUT; # you might want to check what got put into $variable... open STDOUT, '>-'; # reopen the real stdout