|
NAMESSN::Validate - Perl extension to do SSN ValidationSYNOPSISuse SSN::Validate; my $ssn = new SSN::Validate; or my $ssn = SSN::Validate->new({'ignore_bad_combo' => 1}); if ($ssn->valid_ssn("123-45-6789")) { print "It's a valid SSN"; } my $state = $ssn->get_state("123456789"); my $state = $ssn->get_state("123"); print $ssn->valid_area('123') ? "Valid" : "Invalid"; print $ssn->valid_area('123-56-7890') ? "Valid" : "Invalid"; DESCRIPTIONThis module is intented to do some Social Security Number validation (not verification) beyond just seeing if it contains 9 digits and isn't all 0s. The data is taken from the Social Security Admin. website, specifically:http://www.ssa.gov/foia/stateweb.html As of this initial version, SSNs are validated by ensuring it is 9 digits, the area, group and serial are not all 0s, and that the area is within a valid range used by the SSA. It will also return the state which the SSN was issues, if that data is known (state of "??" for unknown states/regions). A SSN is formed by 3 parts, the area (A), group (G) and serial (S): AAAA-GG-SSSS METHODS
TODO* Change how the data is stored. I don't like how it is done now... but works.* Find out state(s) for areas which aren't known right now. * Automate this module almost as completely as possible for distribution. * Consider SSN::Validate::SSDI for Social Security Death Index (SSDI) * Possibly change how data is stored (first on TODO), and provide my extract script for people to run on their own. This way, maybe they could update the SSA changes on their own, instead of being dependant on the module for this, or having to update the module when the SSA makes changes. I think I like this idea. EXPORTNone by default.BUGSPlease let me know if something doesn't work as expected.You can report bugs via the CPAN RT: <http://rt.cpan.org/NoAuth/Bugs.html?Dist=SSN-Validate> If you are feeling nice, and would like quicker fixes, please provide a diff against Validate.pm and the appropriate test file(s). If you are making something invalid which is currently valid, or vice versa, please provide a reference to why the change is needed. Thanks! Patches Welcome! AUTHORKevin Meltzer, <kmeltz@cpan.org>LICENSESSN::Validate is free software which you can redistribute and/or modify it under the same terms as Perl itself.SEE ALSO<http://www.ssa.gov/foia/stateweb.html>, <http://www.irs.gov/pub/irs-utl/1346atta.pdf>, <http://www.ssa.gov/employer/highgroup.txt>.
Visit the GSP FreeBSD Man Page Interface. |