in reply to IO::Socket::INET, quake, and me...

Aside from checking a different script for what you are trying to do here is my USD $.02. the while ( <$socket> ) { function you've defined using <>'s to read the incoming line. AFAIK the brackets are waiting for a \n (carriage return) before executing the loop. I suggest putting some reading into syswrite and sysread to replace your print $socket and while (<$socket>) {. I've used them in a similar situation and they're quite easy to implement. Something like:
syswrite($socket, "$prep rcon $rcon_passwd status\r");
Is the equivalent of the print function and:
while ( (sysread($socket, $incoming, 1024) != 0) { print $incoming; }
Will replace your bracket implementation.

-Adam Stanley
Nethosters, Inc.