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;