Data-Type-0.02.02

NAME

Data::Type::Docs::Howto - Point to point recipes how to get things done

TYPICAL SCENARIOS

Here some words on major fields where perl and Data::Type may be used. Generally you may use Data::Type::Guard (drawback: currently inferior problem reports) for a group of types, or use valid() one by one. Prompting the user when he made mistakes is best done with the summary() function (supports localized texts) or by simply translating the thrown exceptions to non-programmer-style instructions.

CGI

Web formfields ares definitivly the painmaker number one. Testing whether the user entered what you want is no more a difficult task. Data::Type also helps you to provide this nice red marks near incorrect input fields, to point the user what was wrong. A fictive form

[Info] Visit the contrib/cgi_application_datatype_verifier.pl under the distributions root directory. It provides a machine-independant approach to type verification. Via this cgi-script you install Data::Type on one machine and all others with network access can harness it (even from another language then perl).

DBI

Imagine you want to test whether all email addresses in an existing database are active/valid. Since no known database vendor has a custom "email" datatype included AFAIK, Data::Type shines here: