Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 976 Categories, Downloaded 29.545.319 Times

Data::Type 0.01.04

  Date Added: July 14, 2010  |  Visits: 794

Data::Type

Report Broken Link
Printer Friendly Version


Product Homepage
Download (78 downloads)



Data::Type is a Perl module with versatile data and value types. SYNOPSIS use Data::Type qw(:all); use Error qw(:try); try { verify $email , EMAIL; verify $homepage , URI(http); verify $cc , CREDITCARD( MASTERCARD, VISA ); verify $answer_a , YESNO; verify $gender , GENDER; verify one , ENUM( qw(one two three) ); verify [qw(two six)], SET( qw(one two three four five six) ) ); verify $server_ip4 , IP(v4); verify $server_ip6 , IP(v6); verify A35231AH1 , CINS; verify 14565935 , ISSN; verify DE , LANGCODE; verify German , LANGNAME; verify 012345678905, UPC(); verify 5276440065421319, CREDITCARD( MASTERCARD ) ); verify ATGCAAAT , BIO::DNA; verify AUGGGAAAU , BIO::RNA; verify 01001001110110101, BINARY; verify 0F 0C 0A, HEX; verify 0 , DEFINED; verify 234 , NUM( 20 ); verify 1 , BOOL( true ); verify 100 , INT; verify 1.1 , REAL; my $foo = bless( 123, SomeThing ); verify $foo , REF; verify $foo , REF( qw(SomeThing Else) ); verify [ bar ] , REF( ARRAY ); verify x 20 , VARCHAR( 20 ); verify 2001-01-01 , DATE( MYSQL ); verify 16 Nov 94 22:28:20 PST , DATE( DATEPARSE ); verify 9999-12-31 23:59:59, DATETIME; verify 1970-01-01 00:00:00, TIMESTAMP; verify -838:59:59 , TIME; verify 2155 , YEAR; verify 69 , YEAR(2); verify 0 x 20 , TINYTEXT; verify 0 x 20 , MEDIUMTEXT; verify 0 x 20 , LONGTEXT; verify 0 x 20 , TEXT; verify 80 , PORT; verify www.cpan.org, DOMAIN; } catch Type::Exception with { my $e = shift; printf "Expected %s %s at %s line %sn", $e->value, $e->type->info, $e->was_file, $e->was_line; foreach my $entry ( testplan( $e->type ) ) { printf "texpecting it %s %s ", $entry->[1] ? is : is NOT, $entry->[0]->info(); } }; # believe it or not, this really works foreach ( EMAIL, WORD, CREDITCARD( MASTERCARD, VISA ), BIO::DNA, HEX ) { print $_->info; print $_->usage; print $_->export; # does it have other names print $_->param; # what are my choice i.e. [yes,no] print $_->isa( IType::Business ); # is it a Business related type ? print $_->VERSION; # first apperance in Data::Type release } # tied interface (alias typ) try { typ ENUM( qw(DNA RNA) ), ( my $a, my $b ); print "a is typed" if istyp( $a ); $a = DNA; # $alias only accepts DNA or RNA $a = RNA; $a = xNA; # throws exception untyp( $alias ); } catch Type::Exception ::with { printf "Expected %s %s at %s line %sn", $e->value, $e->type->info, $e->was_file, $e->was_line; }; dverify( $email, EMAIL ) or die $!; my $g = Data::Type::Guard->new( allow => [ Human, Others ], # blessed objects of that type tests => { email => EMAIL( 1 ), # mxcheck ON ! see Email::Valid firstname => WORD, social_id => [ NUM, VARCHAR( 10 ) ], contacts => sub { my %args = @_; exists $args{lucy} }, } ); $g->inspect( $h ); # compact version overify { email => EMAIL( 1 ), firstname => WORD }, $object_a, $object_b; print toc(); print catalog(); This module supports versatile data and value 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..

Requirements: No special requirements
Platforms: Linux
Keyword: Datatype Dna E- Email Libraries Perl Module Print Qw Rna Value Varchar Verify Word
Users rating: 0/10

License: Freeware Size: 22.53 KB
USER REVIEWS
More Reviews or Write Review


DATA::TYPE RELATED
Libraries  -  Net::DNS::ValueDomain::DDNS 0.02
Net::DNS::ValueDomain::DDNS is a Perl module to update your Value-Domain (https://www.value-domain.com/) DynamicDNS records. SYNOPSIS use Net::DNS::ValueDomain::DDNS; # Normal usage my $ddns = Net::DNS::ValueDomain::DDNS->new;...
11.26 KB  
Libraries  -  Alien Perl module 0.91
Alien Perl module package contains external libraries wrapped up for your viewing pleasure! SYNOPSIS perldoc Alien; Alien is a package that exists just to hold together an idea, the idea of Alien:: packages, so there is no code here, just...
10.24 KB  
Libraries  -  Test::Reporter::Date::Format 1.27
Test::Reporter::Date::Format Perl module contains date formating subroutines. SYNOPSIS use Test::Reporter::Date::Format; @lt = localtime(time); print time2str($template, time); print strftime($template, @lt); print time2str($template,...
23.55 KB  
Libraries  -  Math::Combinatorics 0.09
Math::Combinatorics is a Perl module that can perform combinations and permutations on lists. SYNOPSIS Available as an object oriented API. use Math::Combinatorics; my @n = qw(a b c); my $combinat = Math::Combinatorics->new(count => 2,...
10.24 KB  
Libraries  -  XML::All 0.02
XML::All is a Perl module that contains overloaded XML objects. SYNOPSIS use XML::All; my $xml = 1 2 3 >; print $$xml; # a print join ", ", @$xml; # 1, 2 , 3 print...
25.6 KB  
Libraries  -  Locale::Maketext::Fuzzy 0.02
Locale::Maketext::Fuzzy is a Perl module for Maketext from already interpolated strings. SYNOPSIS package MyApp::L10N; use base Locale::Maketext::Fuzzy; # instead of Locale::Maketext package MyApp::L10N::de; use base MyApp::L10N; our...
6.14 KB  
Libraries  -  Bio::Tree::Compatible 1.5.2_102
Bio::Tree::Compatible is a Perl module for testing compatibility of phylogenetic trees with nested taxa. SYNOPSIS use Bio::Tree::Compatible; use Bio::TreeIO; my $input = new Bio::TreeIO(-format => newick, -file => input.tre); my $t1 =...
5.6 MB  
Libraries  -  Exception::Class 1.23
Exception::Class is a Perl module that allows you to declare real exception classes in Perl. SYNOPSIS use Exception::Class ( MyException, AnotherException => { isa => MyException }, YetAnotherException => { isa => AnotherException,...
16.38 KB  
Libraries  -  Env::Path 0.18
Env::Path is a Perl module with advanced operations on path variables. SYNOPSIS use Env::Path; # basic usage my $manpath = Env::Path->MANPATH; $manpath->Append(/opt/samba/man); for ($manpath->List) { print $_, "n" }; # similar to above...
10.24 KB  
Libraries  -  Proc::Forking 1.38
Proc::Forking is a Perl module that provides a set of tool to fork and daemonize. SYNOPSIS #!/usr/bin/perl use strict; use Proc::Forking; use Data::Dumper; use Time::HiRes qw(usleep); # to allow micro sleep my $f = Proc::Forking->new();...
11.26 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  FLEX-db Digital Asset Manager 3.0.9
FLEX-db - an enterprise Digital Asset Manager (DAM). It ingests and links metadata with files, creates thumbnails, and processes files using business rules. FLEX-db has a JSP client, Java app server for file input and output and an EJB metadata...
21.57 MB  
Programming  -  Libicom 0.9.0
The libicom library is a character based dynamicly linked library for Linux. It is used to remotely control the Icom IC-R8500 wide band receiver via an RS232 link. All call and return parameters to the control functions are character string based....
20.48 KB  
Programming  -  dotdesktop 0.3
Dotdesktop library provides ability to parse desktop entry file and access the information in a convenient way. Desktop entry file format is defined by freedesktop.org, it is used to describe information about an application such as the name and...
327.68 KB  
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  libyasl 0.2
Libyasl is a C++ class library to easily realize TCP/UDP/Multicast clientsand servers in IPv4 and IPv6 environments under GNU/Linux systems.
143.36 KB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB  
Libraries  -  App::SimpleScan::Substitution::Line 2.02
App::SimpleScan::Substitution::Line is a line with optional fixed variable values. SYNOPSIS my $line = App::SimpleScan::Substitution::Line->new(" this "); # Use only this value when substituting " ". $line->fix(substituite =>...
54.27 KB