openmy$FH, '<', $fileor croak "unable to read $file: $!";
my$contents= do{ local$/; <$FH> }; ## no critic (Local)
close$FH;
return$contents;
}
subverbose {
return$_[0]->{verbose} if1 == scalar@_;
return$_[0]->{verbose} = $_[1];
};
1;
# ABSTRACT: DMARC utility functions
=pod
=head1 NAME
Mail::DMARC::Base - DMARC utility functions
=head1 VERSION
version 1.20130615
=head1 METHODS
=head2 is_public_suffix
Determines if part of a domain is a Top Level Domain (TLD). Examples of TLDs are com, net, org, co.ok, am, and us.
Determination is made by consulting a Public Suffix List. The included PSL is from mozilla.org. See http://publicsuffix.org/list/ for more information, and a link to download the latest PSL.
The authors of this module anticipate adding a function to this class which will periodically update the PSL.
=head2 has_dns_rr
Determine if a DNS Resource Record of the specified type exists at the DNS name provided.
=head2 get_resolver
Returns a (cached) Net::DNS::Resolver object
=head2 is_valid_ip
Determines if the supplied IP address is a valid IPv4 or IPv6 address.
=head2 is_valid_domain
Determine if a string is a legal RFC 1034 or 1101 host name.
Half the reason to test for domain validity is to shave seconds off our processing time by not having to process DNS queries for illegal host names. The other half is to raise exceptions if methods are being called incorrectly.