Business-RO-CNP

 view release on metacpan or  search on metacpan

lib/Business/RO/CNP.pm  view on Meta::CPAN


 print $cnp->birthday;
 print $cnp->birthday->ymd;
 print $cnp->birthday->strftime('%d %m %y');
 print $cnp->birthday->set_locale('ro')->month_name;

Check the L<DateTime|DateTime> module for finding out what methods you can use with this object.

=head2 county

This method returns the county where the person was born or where he received the CNP.

 print $cnp->county;

=head2 county_id

This method returns the county ID which is the pair of digits 8 and 9 in the CNP.

Bucharest has the ID 40 but its sectors also have their own IDs.

 print $cnp->county_id;

=head2 checksum

This method returns the last digit in the CNP and represents a pre-calculated value based on the first 12 digits of the CNP.

 print $cnp->checksum;

=head2 validator

This method calculates the checksum from the first 12 digits of the CNP and it should be equal to the result of the checksum method in order to prove that the CNP is valid.

 print $cnp->validator;

=head2 cnp

This method returns the CNP given as parameter to the object constructor.

 print $cnp->cnp;

=head2 order_number

This method returns the 3-digit order number from the CNP.

 print $cnp->order_number;

=head2 century

This method returns the century in which the person was born.

 print $cnp->century;

=head1 AUTHOR

Octavian Rasnita, C<< <orasnita at gmail.com> >>

=head1 INCOMPATIBILITIES

No known incompatibilities.

=head1 BUGS AND LIMITATIONS

Please report any bugs or feature requests to C<bug-business-ro-cnp at rt.cpan.org>, or through
the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Business-RO-CNP>.  I will be notified, and then you'll
automatically be notified of progress on your bug as I make changes.

=head1 DIAGNOSTICS

=head1 CONFIGURATION AND ENVIRONMENT

No configuration is necessary.

=head1 DEPENDENCIES

L<Moose|Moose>, L<DateTime::Format::Strptime|DateTime::Format::Strptime>

=head1 SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Business::RO::CNP

You can also look for information at:

=over 4

=item * RT: CPAN's request tracker

L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Business-RO-CNP>

=item * AnnoCPAN: Annotated CPAN documentation

L<http://annocpan.org/dist/Business-RO-CNP>

=item * CPAN Ratings

L<http://cpanratings.perl.org/d/Business-RO-CNP>

=item * Search CPAN

L<http://search.cpan.org/dist/Business-RO-CNP/>

=back

=head1 ACKNOWLEDGEMENTS

I found the algorithm for CNP validation on L<http://www.validari.ro/cnp> and the counties IDs on L<http://ro.wikipedia.org/wiki/Cod_numeric_personal>.

=head1 LICENSE AND COPYRIGHT

Copyright 2010 Octavian Rasnita.

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.

=cut



( run in 1.863 second using v1.01-cache-2.11-cpan-13bb782fe5a )