portability of chat2.pl from 4.035 
Author Message
 portability of chat2.pl from 4.035

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

                        ($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



Thu, 16 Feb 1995 06:53:49 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. bug/typo in 4.035 bigfloat.pl

2. gethostbyname() crash in pl 4.035 under SunOS 4.1.?

3. Fix for timelocal.pl in 4.035

4. Chat2.pl, ftp.pl, etc

5. chat2.pl, hget.pl and socket.ph problems

6. socket.ph, ftp.pl and chat2.pl error found for Solaris and Irix

7. help with ftp.pl/chat2.pl

8. chat.pl & chat2.pl

9. More fun with chat2.pl and select.pl

10. Help: problem with ftp.pl and chat2.pl

11. hget.pl, chat2.pl and socket.ph problems

12. ANNOUNCE:chat3-a1.pl is chat2.pl + logging facilities

 

 
Powered by phpBB® Forum Software