Data::FormValidator::Constraints:Japanese - Japan-Specific Constraints For Data::FormValidator
use Data::FormValidator::Constraints::Japanese qw(:all); my $rv = Data::FormValidator->check(\%input, { hiragana => hiragana(), katakana => katakana(), jp_mobile_email => jp_mobile_email(), jp_imode_email => jp_imode_email(), jp_ezweb_email => jp_ezweb_email(), jp_vodafone_email => jp_vodafone_email(), jp_zip => jp_zip(), }, # or, use the regular functions my $rv = Data::FormValidator->check(\%input, { nihongo => sub { my($dfv, $value) = @_; return match_hiragana($value) && ! match_katakana($value); } });
D::FM::C::Japanese provides you with contraint methods that makes it easier to validate your Japanese input using Data::FormValidator.
Returns a closure that checks if the input is all in hiragana
Returns a closure that checks if the input is all in katakana
Yes, I only made two functions for this release. I'll release more upon request, or when I encounter something new to validate. Patches welcome.
Copyright (c) 2006 Daisuke Maki <dmaki@cpan.org> All rights reserved.
To install Data::FormValidator::Constraints::Japanese, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::FormValidator::Constraints::Japanese
CPAN shell
perl -MCPAN -e shell install Data::FormValidator::Constraints::Japanese
For more information on module installation, please visit the detailed CPAN module installation guide.