Net::PortTest - Perl extension for running banner tests against INET services
use Net::PortTest; on 143 => sub { my $sock = shift; my $results = {}; my $rc = -1; $results->{banner} = $sock->getline; $rc = 0 if $results->{banner} =~ '^\* OK'; return $rc, $results; }; # alias some non standard ports to use the same # test function alias qw/ 10143 20143 / => 143; my $results = run_tests '1.2.3.4' => 143; # or, pass in an array of ports $results = run_tests '1.2.3.4' => qw/ 143 10143 20143 /;
This module is used as a framework for quickly and easily defining functions used to check internet services. The simplest examples are in the code, and they show how to execute a naiive IMAP banner check against an IP address.
This module will export the following functions into the main namespace:
run_tests, on and alias
run_tests
on
alias
when the module is loaded with:
use Net::PortTest ':all';
This module makes use of Net::Socket::INET for the communications with the external services.
Please submit all bugs via https://github.com/petermblair/Perl-CPAN/issues
Peter Blair, <cpan@petermblair.com>
Copyright (C) 2013 by Peter Blair
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.2 or, at your option, any later version of Perl 5 you may have available.
To install Net::PortTest, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::PortTest
CPAN shell
perl -MCPAN -e shell install Net::PortTest
For more information on module installation, please visit the detailed CPAN module installation guide.