| 1 | package MooseX::Types::CNPJ; | ||
| 2 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 1 | our $VERSION = '0.02'; | |
| 6 | 1 | our $AUTHORITY = 'CPAN:TBR'; | |
| 7 | |||
| 8 | 1 | ▶ | use MooseX::Types -declare => ['CNPJ']; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 1 | ▶ | use MooseX::Types::Moose qw(Str); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | 1 | ▶ | use Business::BR::CNPJ; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | 0 | ▶ | sub _validate_cnpj { |
|
Subroutine
_validate_cnpj: not called CC=1 SCAR=6.9
| |||
| 13 | 0 | my ($str) = @_; | |
| 14 | 0 | return test_cnpj($str); | |
| 15 | } | ||
| 16 | |||
| 17 | subtype CNPJ, | ||
| 18 | as Str, | ||
| 19 | 0 | ▶ | where { _validate_cnpj($_) }, |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 20 | 0 | ▶ | message { 'CNPJ is invalid' }; |
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||
| 21 | |||
| 22 | |||
| 23 | 1 | 1; | |
| 24 | |||
| 25 | __END__ | ||