Data::Validate::MySQLValidate against MySQL data types | |
Download |
Data::Validate::MySQL Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- Richard Sonnen
- Publisher web site:
- http://search.cpan.org/~sonnen/
Data::Validate::MySQL Tags
Data::Validate::MySQL Description
Validate against MySQL data types Data::Validate::MySQL is a Perl module that collects common validation routines to check suspect values against MySQL column types. For example, you can check to make sure your integer values are within range, your strings aren't too big, and that your dates and times look vaguely ISO-ish. Validating your values before trying to insert them into MySQL is critical, particularly since MySQL is very tolerant of bad data by default, so you may end up with useless values in your tables even if the database doesn't complain.All functions return an untainted value if the test passes, and undef if it fails. This means that you should always check for a defined status explicitly. Don't assume the return will be true. (e.g. is_integer('0'))The value to test is always the first (and often only) argument.SYNOPSIS use Data::Validate::MySQL qw(is_int); die "That's not an unsigned integer!" unless defined(is_int($suspect, 1)); # or as an object my $v = Data::Validate::MySQL->new(); die "That's not an unsigned integer!" unless defined($v->is_int($suspect, 1)); Requirements: · Perl
Data::Validate::MySQL Related Software