udpサーバーでtracerouteの送信文字を見る
use strict; use warnings; use IO::Socket::INET; my $s = IO::Socket::INET->new( LocalAddr => "0.0.0.0", LocalPort => 9000, ReuseAddr => 1, Proto => "udp" ) or die $!; while(1) { my $txt; $s->recv($txt, 128); if ($txt) { print "$txt\n"; } } __END__ $ traceroute localhost -p 9000 を送るとサーバー側で以下が出力される @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefg