home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ferkel.ucsb.edu!taco!rock!concert!rutgers!cs.utexas.edu!news
- From: meyering@cs.utexas.edu (Jim Meyering)
- Newsgroups: comp.lang.perl
- Subject: portability of chat2.pl from 4.035
- Message-ID: <l9vvvtINNm38@ai.cs.utexas.edu>
- Date: 29 Aug 92 22:53:49 GMT
- Organization: U of TX at Austin CS Dept
- Lines: 28
- NNTP-Posting-Host: ai.cs.utexas.edu
-
- I've been experimenting with chat2.pl from perl-4.035 and came
- across a minor portability glitch. chat2 has this header:
-
- ## chat.pl: chat with a server
- ## V2.01.alpha.7 91/06/16
- ## Randal L. Schwartz
-
- The problem is that it assumes stty sets characteristics of its
- standard output. On some systems (e.g. some system V and POSIX)
- stty sets characteristics of the input tty.
-
- Here's a patch that worked for me (using the POSIX-compliant stty
- from GNU shellutils-1.7 on a Sun4 running SunOS 4.1.1).
-
- --- chat2.pl.~1~ Sat Aug 29 17:40:12 1992
- +++ chat2.pl Sat Aug 29 17:39:58 1992
- @@ -323,7 +323,7 @@
- ($tty = $pty) =~ s/pty/tty/;
- open($_TTY,"+>$tty") || next;
- select((select($_TTY), $| = 1)[0]);
- - system "stty nl>$tty";
- + system "stty nl<$tty >$tty";
- return ($pty,$tty);
- }
- }
- --
- Jim Meyering | Member of the League for Programming Freedom
- meyering@cs.utexas.edu | Contact me or league@prep.ai.mit.edu for more info.
-