关于socket发送数据的问题(急)

关于socket发送数据的问题(急)

关于socket发送数据的问题(急)
#!/urs/bin/perl -w
use IO::SOCKET;

$sock = IO::Socket::INET->new(peerAddr=>'192.168.1.166',
PeerPort=>8080,
proto=>'udp')||die "can't connect";

foreach(1..10)
{
print "$sock 123\n";
$sock->flush();
}
close($sock);
应该是print $sock "123\n.
应该是print $sock "123\n";