home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!ira.uka.de!chx400!bernina!neptune!weingart
- From: weingart@inf.ethz.ch (Tobias Weingartner)
- Subject: Echo, how do you turn off? ;-}
- Message-ID: <1992Jul30.123857.7794@neptune.inf.ethz.ch>
- Followup-To: comp.lang.perl
- Keywords: echo, perl
- Sender: news@neptune.inf.ethz.ch (Mr News)
- Nntp-Posting-Host: tau.inf.ethz.ch
- Reply-To: weingart@inf.ethz.ch
- Organization: ETH - Switzerland
- Date: Thu, 30 Jul 1992 12:38:57 GMT
- Lines: 27
-
- Ok I thought I was a *NIX hacker, and knew it all.
- However, I need some kind soul to get me out of this
- predicament.
-
- How do you turn off echo in perl, or more specific,
- what the hell am I doing wrong here:
-
- sub toggle_echo {
- local($sgttyb_t) = 'c4 s';
- local($buffer) = '';
- local(@array) = ();
-
- ioctl(STDIN, &TIOCGETP, $buffer);
- @array = unpack($sgttyb_t, $buffer);
- $array[4] ^= &ECHO;
- $buffer = pack($sgttyb_t, @array);
- ioctl(STDIN, &TIOCSETP, $buffer);
- }
-
- This does not seem to work very well... i.e. not at all.
-
- Thanks for any info.
- Please mail me, I'll collate (is that right?), and then
- post a summary.
-
- --Toby.
-
-