I'm frustrated by how often I see people using <SOCK> to read from sockets. <SOCK> will hang until it finds either end-of-file or $/. You should use read, sysread, or recv to read from sockets (unless you have a somewhat unusual protocol that always sends end-of-line on the end of each packet, you know that $/ will match what the remote system is sending as end-of-line, and you don't care if your program hangs when something goes wrong with this).
Your $send_msg = scalar reverse $recv_msg; will move the "\n" to the front of the string which will make trying to read that data with <$sock> not ideal.
FYI, AFAICT sockets are always unbuffered.
- tye (but my friends call me "Tye")In reply to (tye)Re: Sending & Receiving on a socket
by tye
in thread Sending & Receiving on a socket
by Indomitus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |