in reply to Re^2: tcp server (bidirectional)
in thread tcp server (bidirectional)

Look into using exec or system or some other format. Or something like named pipes (a simple block of text for example):

my $string = `date`;
print SOCKET "$string";

Though there are other considerations.
Someting that a lot of people need to realise is that sockets and files are no different (except for initialisation). You can read and write from a socket in the same way that you can from a file. If you understand files, treat them the same way. Gits.