Web | This Site

Perl Home
PERL Functions
© 2011 TutorialsPoint.COM

| Home |  | References |  | About TP |  | Advertising

# PERL getprotoent Function

## Syntax

getprotoent

## Definition and Usage

Returns the next entry from the list of valid protocols:

($name, $aliases, $protocol_number)

## Return Value

- In scalar context undef on error otherwise protocol name.

- In list context empty list on error protocol record (name, aliases, protocol number)

## 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";
    }

Advertisement

Online Image Processing

Indian Baby Names