Data::Validate::VIN - Perl extension for basic validation of North American Vehicle Identification Numbers from 1980 and later
0.03
use Data::Validate::VIN; my $vv = Data::Validate::VIN->new($somePotentialVIN); if ( $vv->valid() ) { print $vv->get('vin'), "\n"; } else { print "$_\n" for @{ $vv->errors() }; }
Data::Validate::VIN provides a simple way to validate the very basics of North American VINs. The only information this module can glean from a valid VIN is the country of manufacture and the year it was produced.
It cannot tell you if a VIN corresponds to an actual vehicle in the world, it just knows what most VINs look like.
The following checks are run:
17 characters expected
The following are allowed : A-H,J-N,P,R-Z,0-9
Note that following are illegal in the 10th position: U,Z,0
Identified through the first two characters in the WMI
Identified by the 10th character in the VIN
This is the 9th character in the VIN
Vehicle Identification Numbers in North America since 1980 can be, very basically and in brief, broken down into three sections: the WMI (World Manufacturer Identifier), the VDS (Vehicle Descriptor Section) and the VIS (Vehicle Identifier Section).
The WMI is the first three characters in the VIN. The first two of these identify manufacturer of the vehicle.
The VDS is the fourth through ninth characters in the VIN. This is typically unique per manufacturer. The ninth digit is the check digit.
The VIS is used to identify the particular vehicle in question.
Accepts an alphanumeric string which will be automatically run through the checks outlined above
Returns 1 if the string sent through new() passed all checks. Returns undef otherwise
Returns an array ref containing any errors encountered while checking the string. Will return an empty array ref if the string passed all tests.
Returns a piece of the VIN or data gleaned from the VIN. Accepts the following:
vin - will always be returned unless an empty string was passed to new()
vid
vis
checkdigit
country
year - returns an array ref, as some characters refer to multiple years.
http://www.access.gpo.gov/nara/cfr/waisidx_05/49cfr565_05.html
http://en.wikipedia.org/wiki/Vehicle_Identification_Number
collin seaton, <cseaton at cpan.org>
<cseaton at cpan.org>
Please report any bugs or feature requests to bug-data-validate-vin at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Data-Validate-VIN. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-data-validate-vin at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Data::Validate::VIN
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Data-Validate-VIN
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Data-Validate-VIN
CPAN Ratings
http://cpanratings.perl.org/d/Data-Validate-VIN
Search CPAN
http://search.cpan.org/dist/Data-Validate-VIN/
None.
Copyright 2011 collin seaton.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Data::Validate::VIN, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Validate::VIN
CPAN shell
perl -MCPAN -e shell install Data::Validate::VIN
For more information on module installation, please visit the detailed CPAN module installation guide.