# add error processing as above $pid = open(KID_TO_READ, "-|"); if ($pid) { # parent while ( ) { # do something interesting } close(KID_TO_READ) || warn "kid exited $?"; } else { # child ($EUID, $EGID) = ($UID, $GID); # suid only exec($program, @options, @args) || die "can't exec program: $!"; # NOTREACHED } It works on Linux but on Windows I get the following error: '-' is not recognized as an internal or external command, operable program or batch file.