endhostent |
讓你的係統不再期望使用gethostent從主機文件中讀取條目。
None
試試下麵的例子:
#!/usr/bin/perl while( ($name, $aliases, $addrtype, $length, @addrs) = gethostent() ){ print "Name = $name\n"; print "Aliases = $aliases\n"; print "Addr Type = $addrtype\n"; print "Length = $length\n"; print "Addrs = @addrs\n"; } sethostent(1); while( ($name, $aliases, $addrtype, $length, @addrs) = gethostent() ){ print "Name = $name\n"; print "Aliases = $aliases\n"; print "Addr Type = $addrtype\n"; print "Length = $length\n"; print "Addrs = @addrs\n"; } #by www.gitbook.net endhostent(); # Closes the database;