Copyright © tutorialspoint.com

PERL recv Function


Syntax

recv SOCKET, SCALAR, LEN, FLAGS


Definition and Usage

Receives a message on SOCKET attempting to read LENGTH bytes, placing the data read into variable SCALAR.The FLAGS argument takes the same values as the recvfrom( ) system function, on which the function is based.

When communicating with sockets, this provides a more reliable method of reading fixed-length data than the sysread function or the line-based operator <FH>.

Return Value

  • Returns in Scalar Context: undef on error or Number of bytes read

Example

NA


Copyright © tutorialspoint.com