#!/usr/bin/perl use strict; use Socket; my $check = 0; my $port = 7000; my $host = "divisionbyzero.net"; my @who, $line; socket(TALKER,PF_INET,SOCK_STREAM,getprotobyname('tcp')); connect(TALKER,sockaddr_in($port,inet_aton($host))); select(TALKER); $| = 1; select('stdout'); sleep 1; print TALKER "who\n"; while() { if(m/\+-{1,80}\+/) { $check++; } if($check) { push @who, $_; } last if ($check > 2); } print TALKER "quit\n"; close TALKER; print "Content-type: text/html\n\n"; print << "end_header"; Who's on Ancient Realms II

Users Currently logged on:

end_header foreach $line (@who) { chomp $line; $line =~ s/\e\[0m*//g; $line =~ s/^\s+//; $line =~ s/\s+$//; $line =~ s/ /\ /g; print "$line
\n"; } print "
"; exit 0;