File: integer.pm

package info (click to toggle)
libcgi-untaint-perl 1.26-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 132 kB
  • sloc: perl: 302; makefile: 2
file content (34 lines) | stat: -rw-r--r-- 703 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package CGI::Untaint::integer;

use strict;
use base 'CGI::Untaint::object';
sub _untaint_re { qr/^([+-]?\d+)$/ }

=head1 NAME

CGI::Untaint::integer - validate an integer

=head1 SYNOPSIS

  my $age = $handler->extract(-as_integer => 'age');

=head1 DESCRIPTION

This Input Handler verifies that it is dealing with an integer.
The integer can be positive or negative, but only in a basic format
(i.e. a string of digits). It will not accept exponentials.

=head1 AUTHOR

Tony Bowden, E<lt>kasei@tmtm.comE<gt>. 

=head1 COPYRIGHT

Copyright (C) 2001 Tony Bowden. All rights reserved.

This module is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.

=cut

1;