- send SOCKET,MSG,FLAGS,TO
- send SOCKET,MSG,FLAGS
-
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 to send to, in which case it does a sendto(2) syscall. Returns the number of characters sent, or the undefined value on error. The sendmsg(2) syscall is currently unimplemented. See "UDP: Message Passing" in perlipc for examples.
ソケットにメッセージを送ります。 スカラ MSG を ファイルハンドル SOCKET に送ろうとします。 同名のシステムコールと同じフラグが指定できます。 接続していないソケットには、send to に接続先を指定しなければならず、 この場合、sendto(2) を実行します。 送信した文字数か、エラー時には、未定義値を返します。 システムコール sendmsg(2) は現在実装されていません。 例については "UDP: Message Passing" in perlipc を参照してください。
Note the characters: depending on the status of the socket, either (8-bit) bytes or characters are sent. By default all sockets operate on bytes, but for example if the socket has been changed using
binmode
to operate with the:encoding(utf8)
I/O layer (seeopen
, or the open pragma), the I/O will operate on UTF-8 encoded Unicode characters, not bytes. Similarly for the:encoding
layer: in that case pretty much any characters can be sent.文字 に関する注意: ソケットの状態によって、(8 ビットの) バイトか 文字を送信します。 デフォルトでは全てのソケットはバイトを処理しますが、 例えばソケットが
binmode
で:encoding(utf8)
I/O 層(open
、 open プラグマを参照してください) を使うように指定された場合、 I/O はバイトではなく、UTF-8 エンコードされた Unicode 文字を操作します。:encoding
層も同様です: この場合、ほとんど大体全ての文字が書き込めます。