endnetent |
讓你的係統不再期望使用getnetent從網絡列表中讀取條目。
None
試試以下例子:
#!/usr/bin/perl use Socket; while ( ($name, $aliases, $addrtype, $net) = getnetent() ){ print "Name = $name\n"; print "Aliases = $aliases\n"; print "Addrtype = $addrtype\n"; print "Net = $net\n"; } setnetent(1); # Rewind the database; #by www.gitbook.net while ( ($name, $aliases, $addrtype, $net) = getnetent() ){ print "Name = $name\n"; print "Aliases = $aliases\n"; print "Addrtype = $addrtype\n"; print "Net = $net\n"; } endnetent(); # Closes the database;