You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
389 B
Raku

# Format: getservbyport(PORT, PROTOCOL);
#!/bin/perl
print "What is the port number? ";
chomp($PORT=<>);
print "What is the protocol? ";
chomp($PROTOCOL=<>);
($name, $aliases, $port, $proto ) = getservbyport($PORT, $PROTOCOL);
print "The getservbyport function returns:
name=$name
aliases=$aliases
port number=$port
prototype=$protocol \n";