endprotoent |
讓你的係統不再期望使用getprotoent從協議列表中讀取條目。
None
試一試以下的例子:
#!/usr/bin/perl
#by www.gitbook.net
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