Business::BR::PIS(3pm)

Business::BR::PIS3pm

Perl module to test for correct pis numbers

Usage

  use Business::BR::PIS; 
  print "ok " if test_pis('121.51144.13-7'); # prints 'ok '
  print "bad " unless test_pis('121.51144.13-0'); # prints 'bad '

Overview

This module handles PIS numbers, testing, formatting, etc.

Export

"test_pis" is exported by default. "canon_pis", "format_pis", "parse_pis" and "random_pis" can be exported on demand.

The check equations

A correct PIS number has a check digit which is computed from the base 10 first digits. Consider the PIS number written as 11 digits

  c[1] c[2] c[3] c[4] c[5] c[6] c[7] c[8] c[9] c[10] dv[1]

To check whether a PIS is correct or not, it has to satisfy the check equation:

  c[1]*3+c[2]*2+c[3]*9+c[4]*8+c[5]*7+
          c[6]*6+c[7]*5+c[8]*4+c[9]*3+c[10]*2+dv[1] = 0 (mod 11) or
                                                   = 1 (mod 11) (if dv[1]=0)

Releases

6 releases since Debian 8 (Jessie); the text changed 2 times.

  1. 8–10
  2. 11
  3. 12–13

Bugs

Absolute lack of documentation by now.

Author

A. R. Ferreira, <[email protected]>

From libbusiness-br-ids-perl 0.0022-3 in Debian 13 (Trixie). Parsed by carta from the page's man source.