#!/usr/bin/perl use IO::Socket; my $sock = IO::Socket::INET->new( LocalAddr => "localhost:9999", ReuseAddr => 1, Listen => SOMAXCONN, ) or die "couldn't create socket: $!\n"; while (1) { my $client = $sock->accept(); while (my $line = <$client>) { print $client join(" ",unpack("(H2)*", $line)), "\n"; } close $client; }