The output is interesting:
use strict;
use IO::Socket;
my $client = new IO::Socket::INET(
PeerAddr => 'any non existent IP',
PeerPort => any port no,
Proto => 'udp'
);
(!$client) && die "failed to create sock: $!";
my ($request, $response);
$request = 'the request to rule the world';
while(1 == 1) {
if (! defined($client->send($request))) {
print "send failed: $!\n";
} else {
print "send succeeded\n";
}
sleep 3;
}
For the ppl using Linux,
Can you make this program print:
"send succeeded" all the time without changing anything in the code?
You are free to make changes in the OS.
regards,
Sauarbh.