File Coverage

blib/lib/CGI/Untaint/integer.pm
Criterion Covered Total %
statement 7 7 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 10 10 100.0


line stmt bran cond sub pod time code
1             package CGI::Untaint::integer;
2              
3 4     4   1475 use strict;
  4         7  
  4         144  
4 4     4   21 use base 'CGI::Untaint::object';
  4         7  
  4         2435  
5 10     10   79 sub _untaint_re { qr/^([+-]?\d+)$/ }
6              
7             =head1 NAME
8              
9             CGI::Untaint::integer - validate an integer
10              
11             =head1 SYNOPSIS
12              
13             my $age = $handler->extract(-as_integer => 'age');
14              
15             =head1 DESCRIPTION
16              
17             This Input Handler verifies that it is dealing with an integer.
18             The integer can be positive or negative, but only in a basic format
19             (i.e. a string of digits). It will not accept exponentials.
20              
21             =head1 AUTHOR
22              
23             Tony Bowden, Ekasei@tmtm.comE.
24              
25             =head1 COPYRIGHT
26              
27             Copyright (C) 2001 Tony Bowden. All rights reserved.
28              
29             This module is free software; you can redistribute it and/or modify
30             it under the same terms as Perl itself.
31              
32             =cut
33              
34             1;