perlcall.pod SAVETMPS/FREETMPS bracket
[p5sagit/p5-mst-13.2.git] / lib / chat2.pl
index 67d0c84..094d3df 100644 (file)
@@ -1,11 +1,13 @@
 # chat.pl: chat with a server
 # Based on: V2.01.alpha.7 91/06/16
-# Randal L. Schwartz (was <merlyn@iwarp.intel.com>)
+# Randal L. Schwartz (was <merlyn@stonehenge.com>)
 # multihome additions by A.Macpherson@bnr.co.uk
 # allow for /dev/pts based systems by Joe Doupnik <JRD@CC.USU.EDU>
 
 package chat;
 
+require 'sys/socket.ph';
+
 if( defined( &main'PF_INET ) ){
        $pf_inet = &main'PF_INET;
        $sock_stream = &main'SOCK_STREAM;
@@ -273,7 +275,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 @_;