Tutorials Point


  Perl Home

  PERL Functions

© 2013 TutorialsPoint.COM


  Home     References     About TP     Advertising  

PERL endprotoent Function



Advertisements

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


Advertisements


  

Advertisements