Programming Perl

Programming PerlSearch this book
Previous: 3.2.65 getservbyportChapter 3
Next: 3.2.67 getsockname

3.2.66 getservent

setservent STAYOPEN

These functions do the same thing as their like-named system library routines - see getservent(3). They iterate through the /etc/services file or its equivalent. The return value in list context is:

($name, $aliases, $port_number, $protocol_name)

In scalar context, getservent returns only the service port name.

Previous: 3.2.65 getservbyportProgramming PerlNext: 3.2.67 getsockname
3.2.65 getservbyportBook Index3.2.67 getsockname