[Van-pm] CGI taint mode
Stas Bekman
stas at stason.org
Tue Dec 6 11:52:57 PST 2005
Vincent Li wrote:
[...]
>>>43 print h2('File MIME type'),
>>>44 uploadInfo($file)->{'Content-Type'};
>
>
> But line 44 uploadinfo function see $file as undefined. line 42 and 44 are
> in the same scope, I don't understand why line 42 and 44 see $file
> differently.
It doesn't see it as undefined. It just doesn't find that file and
uploadInfo($file) returns undef. So you need to write it as:
if (my $info = uploadInfo($file)) {
print $info->{'Content-Type'};
}
else {
warn "can't find $file";
}
--
_____________________________________________________________
Stas Bekman mailto:stas at stason.org http://stason.org/
MailChannels: Assured Messaging(TM) http://mailchannels.com/
The "Practical mod_perl" book http://modperlbook.org/
http://perl.apache.org/ http://perl.org/ http://logilune.com/
More information about the Vancouver-pm
mailing list