| 1 | # this is a back compatibility wrapper around File::Temp. DO NOT | ||||||||||||||||||||||||||||
| 2 | # use this package outside of CGI, i won't provide any help if | ||||||||||||||||||||||||||||
| 3 | # you use it directly and your code breaks horribly. | ||||||||||||||||||||||||||||
| 4 | package CGI::File::Temp; | ||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 17 | $CGI::File::Temp::VERSION = '5.02'; | |||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 17 | ▶ | use parent File::Temp; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | 17 | ▶ | use parent Fh; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 17 | my $appease_cpants_kwalitee = q/ | |||||||||||||||||||||||||||
| 12 | use strict; | ||||||||||||||||||||||||||||
| 13 | use warnings; | ||||||||||||||||||||||||||||
| 14 | #/; | ||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | use overload | ||||||||||||||||||||||||||||
| 17 | 17 | ▶ | '""' => \&asString, | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 18 | 'cmp' => \&compare, | ||||||||||||||||||||||||||||
| 19 | 17 | 'fallback'=>1; | |||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | # back compatibility method since we now return a File::Temp object | ||||||||||||||||||||||||||||
| 22 | # as the filehandle (which isa IO::Handle) so calling ->handle on | ||||||||||||||||||||||||||||
| 23 | # it will fail. FIXME: deprecate this method in v5+ | ||||||||||||||||||||||||||||
| 24 | 2 | ▶ | sub handle { return shift; }; | ||||||||||||||||||||||||||
|
Subroutine
handle: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 62 | ▶ | sub compare { | ||||||||||||||||||||||||||
|
Subroutine
compare: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 27 | 62 | my ( $self,$value ) = @_; | |||||||||||||||||||||||||||
| 28 | 62 | return "$self" cmp $value; | |||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | 550 | ▶ | sub _mp_filename { | ||||||||||||||||||||||||||
|
Subroutine
_mp_filename: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||
| 32 | 550 | my ( $self,$filename ) = @_; | |||||||||||||||||||||||||||
| 33 | # not just "if $filename" so that a file named "0" keeps its name | ||||||||||||||||||||||||||||
| 34 | 550 | ▶ | ${*$self}->{ _mp_filename } = $filename | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $filename and length $filename
MC/DC50%1/2
defined $filename and length $filename
defined $filename
length $filename
Truth table66%2/3
A and B
A= defined $filenameB= length $filename
| |||||||||||||||||||||||||||||
| 35 | if defined $filename && length $filename; | ||||||||||||||||||||||||||||
| 36 | 550 | return ${*$self}->{_mp_filename}; | |||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | 364 | ▶ | sub asString { | ||||||||||||||||||||||||||
|
Subroutine
asString: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 40 | 364 | my ( $self ) = @_; | |||||||||||||||||||||||||||
| 41 | 364 | return $self->_mp_filename; | |||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | 17 | 1; | |||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||