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