defined (my $pid = open(FROM_CHILD, "-|")) or die "can't fork: $!"; if ($pid) { my @output = ; wait; close FROM_CHILD; return @output; } else { exec "/usr/bin/sudo", @command; die "can't exec: $!"; }