home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / perl / 5334 < prev    next >
Encoding:
Internet Message Format  |  1992-08-15  |  1.7 KB

  1. Path: sparky!uunet!cs.utexas.edu!wupost!usc!news!netlabs!lwall
  2. From: lwall@netlabs.com (Larry Wall)
  3. Newsgroups: comp.lang.perl
  4. Subject: Re: How do I make 'stty -echo' work from a net service
  5. Message-ID: <1992Aug15.201559.10614@netlabs.com>
  6. Date: 15 Aug 92 20:15:59 GMT
  7. References: <1992Jul29.073546.4419@id.dth.dk>
  8. Sender: news@netlabs.com
  9. Organization: NetLabs, Inc.
  10. Lines: 26
  11. Nntp-Posting-Host: scalpel.netlabs.com
  12.  
  13. In article <1992Jul29.073546.4419@id.dth.dk> ej@id.dth.dk (Erik Johansen) writes:
  14. : In a perl program I need to request a username without
  15. : echoing it.  This works fine when I am running it from a shell.
  16. : I intend to run it from a tcp net service (/etc/services) but
  17. : here it will not disable echoing ("Not a tty").
  18. : I suppose that solving the above problem involves creating a pty
  19. : but I do not know how to do it.
  20. : Any ideas of how to code this ?
  21.  
  22. Well, ask yourself who's doing the echoing?  With most network services,
  23. the client is doing the echoing, and sending entire lines to the server.
  24. So it's not the server's responsibility to turn off echoing--it's usually
  25. the clients.  If, on the other hand, you're doing a character-oriented
  26. protocol like telnet, then either you're doing the echoing yourself, and
  27. you have perfect control over what you send back, or you're running
  28. it on a pty, as you say.  In general you don't have to open a pty--they're
  29. already there.  For some sample pty code, look at Randal's chat2.pl
  30. that comes with the Perl library.  If you do this then you can suppress
  31. "echo" by simply refusing to forward what you get from the pty back to
  32. the client.  Or run something on the pty that turns off echo itself,
  33. and then you don't have to worry about it.  Those are your options.
  34.  
  35. Larry
  36.