Programming Perl

Programming PerlSearch this book
Previous: 3.2.6 atan2Chapter 3
Next: 3.2.8 binmode

3.2.7 bind


This function does the same thing as the bind system call - see bind(2). It attaches an address (a name) to an already opened socket specified by the SOCKET filehandle. The function returns true if it succeeded, false otherwise (and puts the error code into $!). NAME should be a packed address of the proper type for the socket.

bind S, $sockaddr or die "Can't bind address: $!\n";

See also the example in the section "Sockets" in Chapter 6.

Previous: 3.2.6 atan2Programming PerlNext: 3.2.8 binmode
3.2.6 atan2Book Index3.2.8 binmode