Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 18.217.11.132
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : CheckPort.pm
package Test::TCP::CheckPort;
use strict;
use warnings;
use base qw/Exporter/;
use Net::EmptyPort qw();

our @EXPORT = qw/ check_port /;

sub check_port {
    if ( @ARGV == 3) {
        print Net::EmptyPort::check_port( { host => $ARGV[0], port => $ARGV[1], proto => $ARGV[2] } );
    } else {
        print Net::EmptyPort::check_port( @ARGV );
    }
}

1;

__END__

=head1 NAME

Test::TCP::CheckPort - check if a port is open from command line

=head1 SYNOPSIS

  $^X -MTest::TCP::CheckPort -echeck_port 8080

=head1 DESCRIPTION

This is a wrapper for L<Net::EmptyPort> which checks if a given port
is open, from the command line argument (C<@ARGV>). Because it works
with port numbers in the argument list, you don't need to quote it
when running with the perl executable.

=head1 SEE ALSO

L<Test::TCP> L<Net::EmptyPort>

=cut
© 2025 GrazzMean