blib/lib/CGI/FormBuilder/Field/file.pm untested

filter: Statementstmt 0.0% 0 / 26 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 2 MC/DCmcdc n/a Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 38 SCAR 17.9
CC
2
Cov
0%
tag
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 6.0
1  
2 ###########################################################################
3 # Copyright (c) Nate Wiger http://nateware.com. All Rights Reserved.
4 # Please visit http://formbuilder.org for tutorials, support, and examples.
5 ###########################################################################
6  
7 # file fields are rendered exactly like text fields
8  
9 package CGI::FormBuilder::Field::file;
10  
11 use strict;
12 use warnings;
13 no warnings 'uninitialized';
14  
15 use CGI::FormBuilder::Util;
16 use CGI::FormBuilder::Field::text;
17 use base 'CGI::FormBuilder::Field::text';
18  
19  
20 our $VERSION = '3.10';
21  
22 *render = \&tag;
23 sub tag {
24 my $self = shift;
25 # special catch to make life easier (too action-at-a-distance?)
26 # if there's a 'file' field, set the form enctype if they forgot
27 if ($self->{_form}->smartness) {
28 $self->{_form}{enctype} ||= 'multipart/form-data';
29 debug 2, "verified enctype => 'multipart/form-data' for 'file' field";
30 }
31 return $self->SUPER::tag(@_);
32 }
33  
34 1;
35  
36 __END__