File Coverage

blib/lib/CGI/Untaint/printable.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::printable;
2              
3 4     4   22 use strict;
  4         7  
  4         178  
4 4     4   22 use base 'CGI::Untaint::object';
  4         8  
  4         1480  
5              
6             sub _untaint_re {
7 20     20   160 qr/^([\040-\377\r\n\t]*)$/;
8             }
9              
10             =head1 NAME
11              
12             CGI::Untaint::printable - validate as a printable value
13              
14             =head1 SYNOPSIS
15              
16             my $name = $handler->extract(-as_printable => 'name');
17              
18             =head1 DESCRIPTION
19              
20             This Input Handler verifies that it is dealing with an 'printable'
21             string i.e. characters in the range \040-\377 (plus \r and \n).
22              
23             The empty string is taken to be printable.
24              
25             This is occasionally a useful 'fallback' pattern, but in general you
26             will want to write your own patterns to be stricter.
27              
28             =cut
29              
30             1;