before the system call - on *nix, that is...open(STDIN,"</dev/tty")
But probably you want to use fork:
open(STDIN,"/dev/null"); #do some ops if((my $pid = fork()) == 0) { # child here open(STDIN,"</dev/tty") or die $!; # do some ops... exit; } else { # parent here - STDIN still is /dev/null # more ops... } # any code hereafter will be executed by parent and, # if the exit in the child block wasn't present, # by the child also
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
In reply to Re: Changing STDIN to tty
by shmem
in thread Changing STDIN to tty
by perl_lover
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |