String::Validator::Common - Routines shared by String::Validator Modules.
Version 0.97
There are some methods common to all String::Validator Modules. By starting with this module other String::Validator Modules inherit these methods.
Modules Using String Validator Common use its' new method and then extend the attributes in their own new methods.
use String::Validator::Common; sub new { my $class = shift ; my $self = { @_ } ; use base ( 'String::Validator::Common' ) ; unless ( defined $self->{ some_param } ) { $self->{ some_param } = 'somedefault'; } ... bless $self , $class ; return $self ; }
A String::Validator contains two error variables error and errstring. When an error is found, simply pass a brief description to this method to increment the errorcount, and append the present description to the errstring.
if ( 1 != 2 ) { $self->IncreaseErr( qq /1 Still Doesn't equal 2!/ ) }
This method initializes three key values: $self->{errstring} , $self->{error}, and $self->{string} to NULL, 0, NULL. If no errors are found error and errstring will remain 0 and NULL. string will be used to hold the string being evaluated. Arguments are the string to be evaluated and optionally a second string to be compared with the first. If the strings are mismatched the sub will return 99, and string will remain NULL, the inheriting module should immediately return the error and not contine.
Checks $self->{ string } against $self->{ min_length } and $self->{ max_length } If the length checks pass it returns 0, if one fails it immediately returns the incremented value of error.
CheckCommon is just a shortcut to run Start and Length.
A stub for testing, overridden in actual string validator classes.
Provides these methods for inheritance as described in the String::Validator documentation.
John Karr, <brainbuz at brainbuz.org>
<brainbuz at brainbuz.org>
Please report any bugs or feature requests to bug-string-validator-email at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=String-Validator-Email. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-string-validator-email at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc String::Validator::Email
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
http://rt.cpan.org/NoAuth/Bugs.html?Dist=String-Validator-Email
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/String-Validator-Email
CPAN Ratings
http://cpanratings.perl.org/d/String-Validator-Email
Search CPAN
http://search.cpan.org/dist/String-Validator-Email/
Copyright 2012 John Karr.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 3 or at your option any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
A copy of the GNU General Public License is available in the source tree; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
To install String::Validator::Common, copy and paste the appropriate command in to your terminal.
cpanm
cpanm String::Validator::Common
CPAN shell
perl -MCPAN -e shell install String::Validator::Common
For more information on module installation, please visit the detailed CPAN module installation guide.