Copyright © tutorialspoint.com
endprotoent
Tells the system you no longer expect to read entries from the protocols list using getprotoent.
None
Try out following example:
#!/usr/bin/perl while(($name, $aliases, $protocol_number) = getprotoent()){ print "Name = $name\n"; print "Aliases = $aliases\n"; print "Protocol Number = $protocol_number\n"; } setprotoent(1); # Rewind the database. while(($name, $aliases, $protocol_number) = getprotoent()){ print "Name = $name\n"; print "Aliases = $aliases\n"; print "Protocol Number = $protocol_number\n"; } endprotoent(); # Closes the database