Murat Ünalan > Data-Type-0.02.02 > Data::Type::Collection::Std

Download:
Data-Type-0.02.02.tar.gz

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Source  

NAME ^

Data::Type::Collection::Std - the standard set of data types

SYNOPSIS ^

 valid '0F 0C 0A', STD::HEX;

 valid '0', STD::DEFINED;
 valid '234', STD::NUM( 20 );
 valid '1', STD::BOOL( 'true' );
 valid '100', STD::INT;
 valid '1.01', STD::REAL;

 valid $email, STD::EMAIL;
 valid $homepage, STD::URI('http');
 valid $cc, STD::CREDITCARD( 'MASTERCARD', 'VISA' );
 valid $answer_a, STD::YESNO;
 valid $gender, STD::GENDER;
 valid 'one', STD::ENUM( qw(one two three) );
 valid [qw(two six)], STD::SET( qw(one two three four five six) ) );
 valid $server_ip4, STD::IP('v4');
 valid $server_ip6, STD::IP('v6');
 
 valid 'A35231AH1', STD::CINS;
 valid '14565935', STD::ISSN; 
 valid 'DE', STD::LANGCODE;
 valid 'German', STD::LANGNAME;
 valid '012345678905', STD::UPC();
 valid '5276440065421319', STD::CREDITCARD( 'MASTERCARD' ) );

 my $foo = bless( \'123', 'SomeThing' );
 valid $foo, STD::REF;
 valid $foo, STD::REF( qw(SomeThing Else) );
 valid [ 'bar' ], STD::REF( 'ARRAY' );

 valid '80', STD::PORT;
 valid 'www.cpan.org', STD::DOMAIN;

 valid '<pre>hello</pre><br>', STD::HTML;
 valid '<field>hello</field>', STD::XML;

TYPES ^

STD::BINARY (since 0.01.25)

binary code

Usage

Set of ( [0|1] )

STD::BOOL (since 0.01.25)

boolean value

STD::CINS (since 0.01.03)

CINS

Filters

strip \s

Usage

i.e. 035231AH2

Depends

Business::CINS

STD::COUNTRYCODE (since 0.01.05)

country code

Depends

Locale::SubCountry

STD::COUNTRYNAME (since 0.01.05)

country name

Depends

Locale::SubCountry

STD::CREDITCARD (since 0.01.25)

creditcard

Filters

strip \D

Usage

CREDITCARD( Set of [MASTERCARD|AMEX|DISCOVER|BANKCARD|BLACHE|VISA|JCB|DINERS], .. )

Depends

Business::CreditCard

STD::DATE (since 0.01.01)

date

Usage

DATE employs Date::Parse str2time function.

Depends

Date::Parse

STD::DEFINED (since 0.01.04)

defined value

STD::DOMAIN (since 0.01.04)

domain name

STD::EMAIL (since 0.01.25)

email address

Usage

[MXCHECK as STD::BOOL] MXCHECK results actually tests the mx host via internet (see Email::Valid)

Depends

Email::Valid

STD::GENDER (since 0.01.25)

human gender

STD::GENDER::DE (since 0.01.12)

human gender

STD::HEX (since 0.01.25)

String

Filters

strip \s

Usage

Set of ( ([0-9a-fA-F]) )

STD::HTML (since 0.01.37)

html markup

Usage

( 'structure' (default) | 'fluff' | 'helper' ) They are derived from the HTML::Lint->new() parameters (see HTML::Lint::Error)

Depends

HTML::Lint

STD::INT (since 0.01.27)

integer

Depends

Regexp::Common

STD::IP (since 0.01.04)

IP (v4 or v6) or MAC network address

Depends

Regexp::Common, Net::IPv6Addr

STD::ISSN (since 0.01.03)

ISSN

Filters

strip \s

Usage

example: 14565935

Depends

Business::ISSN

STD::LANGCODE (since 0.01.03)

language code

Filters

strip \s

Depends

Locale::Language

STD::LANGNAME (since 0.01.03)

natural language

Filters

strip \s

Depends

Locale::Language

STD::NUM (since 0.01.25)

number

STD::PATH (since 0.01.06)

path

STD::POD (since 0.01.36)

file containing Pod instructions

Usage

POD() requires a filename value

Depends

Pod::Find

STD::PORT (since 0.01.04)

tcp port number

STD::QUOTED (since 0.01.25)

quoted string

Depends

Regexp::Common

STD::REAL (since 0.01.25)

real

Depends

Regexp::Common

STD::REF (since 0.01.25)

perl reference

STD::REGIONCODE (since 0.01.05)

country region code

Depends

Locale::SubCountry

STD::REGIONNAME (since 0.01.05)

country region

Depends

Locale::SubCountry

STD::SHEBANG (since 0.01.36)

file containing a she-bang (#!)

Usage

( SIGNATURE [, SIGNATURE] ) - SIGNATURE is a text fragment (default: perl)

STD::UPC (since 0.01.03)

UPC

Filters

strip \s

Usage

i.e. 012345678905

Depends

Business::UPC

STD::URI (since 0.01.25)

uri

Depends

Regexp::Common

STD::WORD (since 0.01.25)

word (without whitespaces)

STD::X500::DN (since 0.01.37)

X.500 DN (Distinguished Name)

Usage

()

Depends

X500::DN

STD::XML (since 0.01.06)

xml markup

Depends

XML::Parser

STD::YESNO (since 0.01.25)

primitiv answer

STD::YESNO::DE (since 0.01.14)

primitiv answer

STD::ZIP (since 0.01.14)

zip code

Usage

ZIP( "DE" | "AU" | "DK" | "NL" | "US" | "BE" | "FR" )

Depends

Regexp::Common

INTERFACE ^

CONTACT ^

Sourceforge http://sf.net/projects/datatype is hosting a project dedicated to this module. And I enjoy receiving your comments/suggestion/reports also via http://rt.cpan.org or http://testers.cpan.org.

AUTHOR ^

Murat Uenalan, <muenalan@cpan.org>

syntax highlighting: