I'd like to get people's thoughts on a Validate:: namespace, to contain
standalone modules for validating information.

Modules in this namespace ( such as Validate::Net ) would be used to "check"
values before they are handed off to another module.

For example, Validate::Net->ip( $an_ip_address ) would allow you to check an
ip address has a correct structure, before passing it to Net::Ping or some
other Net:: type module.

Use of these modules would let you catch user input problems early, rather
than having to interpret responses from modules.

Validation methods may also take options, for example Validate::Net->ip(
$an_ip_address, 'host' ), or Validate::Net->ip( $an_ip_address,
'broadcast' ) to test additional properties.

A validator may also be instantiable, using $new = Validate::Net->new(
'fast' ). You would then access it through $new->ip( $an_ip_address ).

The construction argument would allow you to specify different levels of
verification. As an example. Validate::Net has 'fast', 'local' and 'full'
options, where 'fast' only uses code internal to Validate::Net, 'local' can
also use other modules or services local to the host, or 'full' to allow the
validator to access services on other hosts.

For example:

$new = Validate::Net->new( 'full' );
$new->email( $an_email_address );

would be allowed to not only check the email structure, but examine DNS to
make sure the email's host exists, and has a valid MX record.

Anyways, I'm looking for comments before I do an initial upload of
Validate::Net to CPAN, speak now or forever hold your piece.

Adam Kennedy
CPAN Username: ADAMK


Reply via email to