Reading <STDIN> w/out eching to screen
Reading <STDIN> w/out eching to screen
(OP)
I need to read a line of input from <STDIN>
without outputting to screen. ie
like a su command.
without outputting to screen. ie
like a su command.
RE: Reading <STDIN> w/out eching to screen
system('stty -echo');
$response = <STDIN>;
system('stty echo');
print $response;
presuming you're on a unix system....
Mike
michael.j.lacey@ntlworld.com
Cargill's Corporate Web Site
RE: Reading <STDIN> w/out eching to screen
print "enter some information\n";
$info = <STDIN>;
chomp($info);
That should do it. Say you enter "some information" into the program, then the variable $info will have the value "some information" and you can decide what to do with it.
RE: Reading <STDIN> w/out eching to screen
does that stop the "some information" from being echoed on the command line as you type it though? Which I think was charlsey's aim.
Is there a way of doing this on windows?
Loon
RE: Reading <STDIN> w/out eching to screen
Mike
michael.j.lacey@ntlworld.com
Cargill's Corporate Web Site
RE: Reading <STDIN> w/out eching to screen
Loon