linux - Hiding STDIN echo after pressing Enter -


I am working on a messaging system which uses the Unix terminal to make message output more user-friendly For, I wanted to hide & lt; STDIN & gt; In the other message output, use it after pressing the Enter button

  my $ user = "any"; My $ message = & lt; STDIN & gt; #must shows what the user types, but after hiding the message, the message should be hidden $ chomp $ message; Print message file "& lt; $ user & gt; $ message \ n";   

I have read in the forum that some method is using the word :: ReadKey , but unfortunately I am not able to do that because in that module The system does not exist

borrowed It reads a letter at the time, and when the entry is entered, this current line \ r

  Use strict; Use warnings; Sub get_pass {local $ | = 1; My $ ret = ""; While (1) {my $ found = match (); Final if $ is found "" \ n "; $ print; $ ret. = $ Found;} print" \ r "," "x length ($ ret)," \ r "; return $ ret;} My $ user = "any"; my $ message = get_pass (); chomp $ message; print "& lt; $ User & gt; $ Message \ n "; BEGIN {Use POSIX qw (: termios_h); My ($ word, $ oterm, $ echo, $ noecho, $ fd_stdin); $ Fd_stdin = fileno (STDIN); $ word = POSIX :: Termiz-> New Terminator -> $ Term-> Getattr ($ fd_stdin); $ Oterm = $ term-> Millgram (); $ Echo = ECHO | Echoc | ICANON; $ NoiKey = $ Uprum & amp; ; ~ $ Echo; sub shutdown {$ word-> Settle flag ($ noeco); $ word-> Set CC (VTIME, 1); $ word- & gt; Settrer ($ fd_stdin, TCSANOW);} Sub-cooked {$ word-> Settle flag ($ oterm); $ word- & gt; set CC (VTIME, 0); $ word- & gt; Settrer ($ fd_stdin, TCSANOW);} All Meeting {my $ key = ''; cbreak (); sysread (STDIN, $ key, 1); cooked (); return key;}} END {cooked ()}    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -