The 1500 mtu is transparent to you.
If you want to break it up, you do something like this
print $socket,substr($buffer,0,511);
print $socket,substr($buffer,512,512);
etc.
Sending a "\n" forces a sync.
On the other side, the receive in the event of a 1500+ size, it has to be in a loop to get all the data.