X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fchat2.pl;h=504fa7efd7a48d5458f4ca487d3dea3ad761385e;hb=8c99d73ee7ce90de2561496f683f3850d1269e1d;hp=67d0c840695a52cc7e74ba68a6f11f2f3e3c93e8;hpb=79072805bf63abe5b5978b5928ab00d360ea3e7f;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/chat2.pl b/lib/chat2.pl index 67d0c84..504fa7e 100644 --- a/lib/chat2.pl +++ b/lib/chat2.pl @@ -1,11 +1,22 @@ # 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 ) +# Randal L. Schwartz (was ) # multihome additions by A.Macpherson@bnr.co.uk # allow for /dev/pts based systems by Joe Doupnik package chat; +require 'sys/socket.ph'; + if( defined( &main'PF_INET ) ){ $pf_inet = &main'PF_INET; $sock_stream = &main'SOCK_STREAM; @@ -273,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 @_;