Perl Home
PERL Functions
© 2013 TutorialsPoint.COM
|
PERL endhostent Function
Advertisements
Syntax
Definition and Usage
Tells the system you no longer expect to read entries from the hosts file
using gethostent.
Return Value
Example
Try out following example:
#!/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";
}
endhostent(); # Closes the database;
|
|
Advertisements
|
|
|