in reply to Port check - Services File

Note that if all you want to do is collect up the service name related to a port, Perl's got getservbyport:

use warnings; use strict; my @ports = qw(21 22 23); my $protocol = 'tcp'; for (@ports){ my ($name, $alias, $num, $proto) = getservbyport($_, $protocol); print "$num: $name\n"; }