Sends a message on a socket. Attempts to send the scalar MSG to the SOCKET filehandle. Takes the same flags as the system call of the same name. On unconnected sockets, you must specify a destination tosend to, in which case it does asendto(2) syscall. Returns the number of characters sent, or the undefined value on error. Thesendmsg(2) syscall is currently unimplemented. See"UDP: Message Passing" in perlipc for examples.
Note that if the socket has been marked as:utf8,send will throw an exception. The:encoding(...) layer implicitly introduces the:utf8 layer. Seebinmode.
Perldoc Browser is maintained by Dan Book (DBOOK). Please contact him via theGitHub issue tracker oremail regarding any issues with the site itself, search, or rendering of documentation.
The Perl documentation is maintained by the Perl 5 Porters in the development of Perl. Please contact them via thePerl issue tracker, themailing list, orIRC to report any issues with the contents or format of the documentation.