Try
perldoc IO::Socket. Here's a little example:
use IO::Socket;
$socket = IO::Socket::INET->new
(
PeerAddr => '1.1.1.1',
PeerPort => #<open port e.g. 80>,
Proto => "tcp",
Type => SOCK_STREAM
) or die "Could Not open port";
print $socket "Server message\n";
close($socket);
Now, how you interpret messages on the other side is up to you. You can write a server program that mirrors this example above, you can use something like tcpdump with the '-x' option for hexidecimal encoding and decode the message, or you may already have something.