DISCLAIMER THIS IS ALPHA SOFTWARE. DO NOT USE IT. THE DOCUMENTATION MAY BE NOT IN SYNC WITH THE CURRENT CODE. IT IS MORE WORK IN PROGRESS AND CONSTANTLY EVOLVING, AND NOT MADE FOR USE YET. NAME Data::Verify - versatile data/type verification, validation and testing VERSION 0.01.23 (Thu Jan 2 00:20:30 2003) DESCRIPTION This module supports types. Out of the ordinary it supports parameterised types (like databases have i.e. VARCHAR(80) ). When you try to feed a typed variable against some odd data, this module explains what he would have expected. It doesnt support casting (yet). TYPES and FILTERS perl -e "use Data::Verify qw(:all); print catalog()" lists all supported types: Data::Verify 0.01.23 supports 24 types: BOOL - a true or false value DATE - a date DATETIME - a date and time combination EMAIL - an email address ENUM - a member of an enumeration GENDER - a gender (male|female) INT - an integer IP - an IP (V4, MAC) network address LONGTEXT - text with a max length of 4294967295 (2^32 - 1) characters (.. MEDIUMTEXT - text with a max length of 16777215 (2^24 - 1) characters (al.. NUM - a number QUOTED - a quoted string REAL - a real REF - a reference to a variable SET - a set TEXT - blob with a max length of 65535 (2^16 - 1) characters (alias.. TIME - a time TIMESTAMP - a timestamp TINYTEXT - text with a max length of 255 (2^8 - 1) characters (alias my.. URI - an http uri VARCHAR - a string with limited length of choice (default 60) WORD - a word (without spaces) YEAR - a year in 2- or 4-digit format YESNO - a simple answer (yes|no) And 3 filters: chomp - chomps lc - lower cases uc - upper cases GROUPED TOC Logic REF Database Logic ENUM, SET Time or Date related DATE, DATETIME, TIME, TIMESTAMP, YEAR String LONGTEXT, MEDIUMTEXT, TEXT, TINYTEXT Numeric BOOL, INT, NUM, REAL String EMAIL, GENDER, IP, QUOTED, URI, VARCHAR, WORD, YESNO EXAMPLES Look in the t directory (of the release) for examples. Here a very simple one: use Data::Verify qw(:all); use Error qw(:try); try { verify( 'muenalancpan.org' , EMAIL ); print "email valid"; } catch Type::Exception with { print "this is not an email"; }; KEYWORDS data types, data manipulation, data patterns, user input, tie INSTALLATION To install this module type the following: perl Makefile.PL make make test make install CPAN PREREQUISITES Class::Maker, Error, IO::Extended, Regexp::Common, Email::Valid AUTHOR Murat Ünalan, COPYRIGHT/LICENSE (c) 2002 by Murat Ünalan. All rights reserved. Note: This program is free software; you can redistribute it and/or modify it under the same terms as perl itself LAST CHANGES 0.01.23 changed version scheme to x.x.x (read perldelta, 'version' perldoc). renamed MYSQL_* types to *, removed redundant MYSQL_ BLOB types (now there is equivalent TEXT only) changed type IPV4 to general IP('V4') (or 'MAC', using Regexp::Common:net) added Interfaces under IType for grouping the types. Now have ::Numeric, ::Temporal, ::String and ::Logic added toc() which is like catalog(), but showing it grouped by context