home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / perl / 5036 < prev    next >
Encoding:
Text File  |  1992-07-30  |  1.1 KB  |  42 lines

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!ira.uka.de!chx400!bernina!neptune!weingart
  3. From: weingart@inf.ethz.ch (Tobias Weingartner)
  4. Subject: Echo, how do you turn off? ;-}
  5. Message-ID: <1992Jul30.123857.7794@neptune.inf.ethz.ch>
  6. Followup-To: comp.lang.perl
  7. Keywords: echo, perl
  8. Sender: news@neptune.inf.ethz.ch (Mr News)
  9. Nntp-Posting-Host: tau.inf.ethz.ch
  10. Reply-To: weingart@inf.ethz.ch
  11. Organization: ETH - Switzerland
  12. Date: Thu, 30 Jul 1992 12:38:57 GMT
  13. Lines: 27
  14.  
  15. Ok I thought I was a *NIX hacker, and knew it all.
  16. However, I need some kind soul to get me out of this
  17. predicament.
  18.  
  19. How do you turn off echo in perl, or more specific,
  20. what the hell am I doing wrong here:
  21.  
  22. sub toggle_echo {
  23.     local($sgttyb_t) = 'c4 s';
  24.     local($buffer) = '';
  25.     local(@array) = ();
  26.  
  27.     ioctl(STDIN, &TIOCGETP, $buffer);
  28.     @array = unpack($sgttyb_t, $buffer);
  29.     $array[4] ^= &ECHO;
  30.     $buffer = pack($sgttyb_t, @array);
  31.     ioctl(STDIN, &TIOCSETP, $buffer);
  32. }
  33.  
  34. This does not seem to work very well... i.e. not at all.
  35.  
  36. Thanks for any info.
  37. Please mail me, I'll collate (is that right?), and then
  38. post a summary.
  39.  
  40. --Toby.
  41.  
  42.