in reply to hiding perl-wrapped command output

You can use IPC::Run3 to redirect stdout to a perl data structure. Perhaps something like this might do the trick.

use IPC::Run3; my @cmd = qw( /sbin/sfdisk -uM -q -L -O disksave --no-reread /dev/hdz); my ($in, $out, $err); run3 \@cmd, \$in, \$out, \$err;