Data::Validate::WithYAML::Plugin::Country - check whether a given value is a valid country code
version 0.03
Your test.pl:
use Data::Validate::WithYAML; my $validator = Data::Validate::WithYAML->new( 'validate.yml' ); my %params = ( country => 'DE', # more user input ); my %errors = $validator->validate( \%params );
Your validate.yml:
--- country: type: required plugin: Country format: alpha-2 lang: en
Currently this module supports to formats: alpha-2 that are two-letter country codes like 'DE', 'FR', etc. and alpha-3 that is the three-letter code (e.g. DEU, FRA).
And it supports different languages so you use the country codes in your preferred language (see Locale::Country::Multilingual).
Locale::Country::Multilingual
Check if the given value is a valid country code.
Renee Baecker <reneeb@cpan.org>
This software is Copyright (c) 2012 by Renee Baecker.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
To install Data::Validate::WithYAML::Plugin::Country, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Validate::WithYAML::Plugin::Country
CPAN shell
perl -MCPAN -e shell install Data::Validate::WithYAML::Plugin::Country
For more information on module installation, please visit the detailed CPAN module installation guide.