programming-examples/perl/Network/The getservent function reads the next line from the _etc_services file.pl

8 lines
317 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
setservent(1 );
($name, $aliases, $port, $proto) = getservent;
print "Name=$name\nAliases=$aliases\nPort=$port\nProtocol=$protocol\n";
($name, $aliases, $port, $proto) = getservent;
# Retrieves the next entry in /etc/services
print "Name=$name\nAliases=$aliases\nPort=$port\nProtocol=$protocol\n";
endservent;