File Coverage

blib/lib/FormValidator/Lite/Upload/CGI.pm
Criterion Covered Total %
statement 18 18 100.0
branch 1 2 50.0
condition n/a
subroutine 7 7 100.0
pod 0 4 0.0
total 26 31 83.8


line stmt bran cond sub pod time code
1             package FormValidator::Lite::Upload::CGI;
2 3     3   12 use strict;
  3         6  
  3         110  
3 3     3   11 use warnings;
  3         4  
  3         88  
4 3     3   10 use base qw/FormValidator::Lite::Upload/;
  3         3  
  3         659  
5              
6             sub new {
7 11     11 0 13 my ($class, $q, $name) = @_;
8 11         27 my $file = $q->param($name);
9 11 50       328 return unless $file;
10              
11 11         842 my $info = $q->uploadInfo($file);
12 11         619 bless {
13             q => $q,
14             name => $name,
15             info => $info,
16             }, $class;
17             }
18              
19 6     6 0 34 sub size { shift->{info}->{'Content-Length'} }
20 7     7 0 93 sub type { shift->{info}->{'Content-Type'} }
21              
22             sub fh {
23 2     2 0 5 my ($self, ) = @_;
24 2         18 $self->{q}->upload($self->{name});
25             }
26              
27             1;