Beta Shell
v2.0 ยท web2.us.cloudlogin.co
[FM]
[CMD]
[PHP]
[DB]
[INFO]
[SEC]
File Manager
~
/
usr
/
share
/
perl5
/
vendor_perl
/
Test
/
TCP
Upload
3 items
Name
Size
Perms
Modified
Actions
[ .. / .. ]
CheckPort.pm
830 B
-rw-r--r--
2019-10-08 08:16:05
Edit
Del
Editing: CheckPort.pm
(830 B)
Path: /usr/share/perl5/vendor_perl/Test/TCP/CheckPort.pm
Back
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