Copyright © tutorialspoint.com

PERL endprotoent Function


Syntax

endprotoent


Definition and Usage

Tells the system you no longer expect to read entries from the protocols list using getprotoent.

Return Value

  • None

Example

Try out following example:

#!/usr/bin/perl

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

Copyright © tutorialspoint.com