Perl in a Nutshell

Perl in a NutshellSearch this book
Previous: 8.112 Net::PingChapter 8
Standard Modules
Next: 8.114 Net::servent
 

8.113 Net::protoent

Returns information for an Internet protocol. Overrides the core getprotoent, getprotobyname, and getprotobynumber functions with object-oriented versions that return Net::protoent objects. The functions take a default second argument of tcp. The objects have methods that return the fields of the same name from the protoent structure in netdb.h:

FieldDescription
aliasesList of aliases
nameName of host
protoProtocol

You can access the structure fields either with the methods or by importing the fields into your namespace with the :FIELDS import tag and then accessing them by prepending p_ to the field name:

$proto_obj->name()
$p_name


Previous: 8.112 Net::PingPerl in a NutshellNext: 8.114 Net::servent
8.112 Net::PingBook Index8.114 Net::servent