#!/usr/bin/perl -w
use strict;
use IO::Socket;
my $sock = new IO::Socket::INET ( 
									LocalHost => '127.0.0.1',
									LocalPort => 5555,
									Proto => 'tcp',
									Listen => 1,
									Reuse => 1,
								);
die "Could not create socket $!\n" unless $sock;

my $loop = 1;
while ($loop) {
	my $newsock = $sock->accept();
	while(<$newsock>) {
		chomp;
		print "input: $_\n";
		if ($_ eq "OMGWTF") {
			print "Winning!\n";
			$loop = 0;
			close($sock);
			exit;
		}
	}
}
