Try adding a newline after the socket print, that forces it to send(flush).
Otherwise, it will tend to accumulate the sent data in a buffer for efficiency. Search groups.google.com for "perl socket flush" for other methods. The newline is the simplest, but there are modules which turn on auto-flushing.