blib/script/check_email_and_mx.pl untested

filter: Statementstmt 0.0% 0 / 28 Branchbran 0.0% 0 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod n/a totaltotal 0.0% 0 / 42 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 #!/usr/local/bin/perl
2  
3 use strict;
4 use warnings;
5  
6 use Getopt::Long;
7 use Net::validMX;
8  
9 my ($rv, $reason, $sanitized_email);
10 my $debug = 0;
11 my $verbose = 0;
12  
13 GetOptions ("debug" => \$debug, "verbose" => \$verbose);
14  
15 print "Check Valid MX (Net::ValidMX v".Net::validMX::version().")\n\n" if $verbose;
16  
17 #RUN ME WITH EMAIL ADDRESS PARAMETERS
18 if (scalar(@ARGV) > 0) {
19 foreach $ARGV (@ARGV) {
20 if ($ARGV =~ /\@/) {
21 Net::validMX::set_debug($debug);
22 ($rv, $reason, $sanitized_email) = Net::validMX::check_email_and_mx($ARGV);
23  
24 print Net::validMX::get_output_result($sanitized_email, $rv, $reason) if $verbose;
25 if (scalar(@ARGV) == 1) {
26 exit($rv != 1);
27 }
28 } else {
29 print "Invalid Argument: $ARGV\n";
30 }
31 }
32 } else {
33 print "Error: Insufficient Number of Arguments\n\n\t$0 " . '$email_address' . "\n\n";
34 exit 1;
35 }
36  
37 1;