- or download this
use strict;
use IO::Socket;
...
die "sysread: $!" if (!defined($length));
# $buffer contains the received packet
}
- or download this
use strict;
use IO::Socket;
...
or die "socket: $!";
syswrite($socket, "Hello, there\n");
- or download this
my $length;
while (defined($length=sysread($socket, my $buffer, 65536)) && $length
+ != 0)
{ ... }
die "sysread: $!" if (!defined($length));