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.24 (Fri Jan 3 00:48:50 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). Functionality was utilised amongst others by Regexp::Common, Email::Valid and Business::CreditCard. TYPES and FILTERS perl -e "use Data::Verify qw(:all); print catalog()" lists all supported types: Data::Verify 0.01.24 supports 25 types: BOOL - a true or false value CREDITCARD - is one of a set of creditcard type (DINERS, BANKCARD, VISA, .. 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 (can have a maximum of 64 members (mysql)) 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 4 filters: chomp - chomps lc - lower cases strip - strip whitespaces uc - upper cases GROUPED TOC Logic CREDITCARD, 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 CREDITCARD known formats This feature isn't well tested yet (Because of lack of creditcard numbers for testing). Supported are: 'Diners Club', 'Australian BankCard', 'VISA', 'Discover/Novus', 'JCB', 'MasterCard', 'Carte Blache', 'American Express'. They are parameterised as: DINERS, BANKCARD, VISA, DISCOVER, JCB, MASTERCARD, BLACHE, AMEX. 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, form data, user input, tie INSTALLATION To install this module type the following: perl Makefile.PL make make test make install CPAN PREREQUISITES Class::Maker (0.05.10), Error (0.15), IO::Extended (0.05), Regexp::Common (1.20), Email::Valid (0.14), Tie::ListKeyedHash (0.41), Business::CreditCard (0.27), Iter (0) 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.24 added Tie::ListKeyedHash (0.41) to the Makefile.PL prerequisites cleaned some of the pod documentation added new type CREDITCARD (uses Business::CreditCard for LUHN mod10) supported types are: DINERS, BANKCARD, VISA, DISCOVER, JCB, MASTERCARD, BLACHE, AMEX