Mega Code Archive

 
Categories / Perl / Network
 

Getprotoent function reads the next line from the network protocols database, etcprotocol, and returns a list

#Format #getprotoent; #setprotoent (STAYOPEN); #endprotoent; while (($name,  $aliases, $proto ) = getprotent){ printf "name=%-5s,aliases=%-6sproto=%-8s\n",         $name, $aliases, $proto; }