Perl Script to Get Protocol Name and Number

How to Find Out Protocol Name and Number

The below Perl script for identifying protocol by using protocol name as an argument. This script returns its name, name alias if any and the protocol number. This is an easiest way to get the protocol number

Perl Code to Get Protocol Number

# Format: getprotobyname(NAME);
($name, $aliases, $proto ) = getprotobyname('tcp');
print "name=$name aliases=$aliases $protocol number=$proto\n";

Related Topic What is Scalar Values Manipulation in Perl Scripting
How to Reset and Set Mysql Password on Ubuntu
A to Z Linux Commands quick reference sheet
Server Machine Time in Perl
Two way Client Server Network Communication 2011   Privacy Policy  Terms of Service  Feedback