make eq unicode-aware (from Gisle Aas); fix bogus tests revealed
[p5sagit/p5-mst-13.2.git] / lib / chat2.pl
index 8320270..504fa7e 100644 (file)
@@ -1,4 +1,13 @@
 # chat.pl: chat with a server
+#
+# This library is no longer being maintained, and is included for backward
+# compatibility with Perl 4 programs which may require it.
+#
+# In particular, this should not be used as an example of modern Perl
+# programming techniques.
+#
+# Suggested alternative: Socket
+#
 # Based on: V2.01.alpha.7 91/06/16
 # Randal L. Schwartz (was <merlyn@stonehenge.com>)
 # multihome additions by A.Macpherson@bnr.co.uk
@@ -264,7 +273,7 @@ ESQ
                eval $cases; die "$cases:\n$@" if $@;
        }
        $eof = $timeout = 0;
-       &$subname();
+       do $subname();
 }
 
 ## &chat'print([$handle,] @data)
@@ -275,7 +284,9 @@ sub print { ## public
        if ($_[0] =~ /$nextpat/) {
                *S = shift;
        }
-       print S @_;
+
+       local $out = join $, , @_;
+       syswrite(S, $out, length $out);
        if( $chat'debug ){
                print STDERR "printed:";
                print STDERR @_;