programming-examples/perl/Network/Checking for an open port.pl
2019-11-15 12:59:38 +01:00

8 lines
156 B
Perl

#!/usr/bin/perl -w
# Finds an open port.
$port = 2345;
while (getservbyport($port, "tcp") ) {
$port++;
}
print "An open port number is $port\n";