February 2012
Intermediate to advanced
1184 pages
37h 17m
English
getservbyportPORT,PROTO
This function translates a service (port) number to its
corresponding names. PROTO is a protocol name
such as “tcp”. The return value in
list context is:
# 0 1 2 3 ($name, $aliases, $port_number, $protocol_name) = getservbyport(80, "tcp");
In scalar context, getservbyport returns only the service name.
The Net::servent module supports a by-name interface to this function. See
getservbyport(3).
Read now
Unlock full access