programming-examples/perl/Network/The getservent function reads the next line from the _etc_services file.pl
2019-11-15 12:59:38 +01:00

8 lines
317 B
Raku

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;