Subject: | CGI.pm bug in exists() on tied param hash |
Description of problem: The CGI.pm package's exist() function override
for tied
hashes fails. It always reports any given param does not exist. This can
potentially break a _lot_ of CGI scripts.
Version-Release number of selected component (if applicable):
CGI.pm 3.38 (works in 3.37), which was included in
perl-5.10.0-31.fc9.i386 built July 24.
How reproducible: Very; every time.
Steps to Reproduce:
1. Run the attached program like so:
exists_test.pl a=1 b=2 c=3
2.
3.
Actual results:
Key: 'a', does not exist (yet it has value '1').
Deleting $input{a}.
Key: 'a', does not exist.
Key: 'b', does not exist (yet it has value '2').
Deleting $input{b}.
Key: 'b', does not exist.
Key: 'c', does not exist (yet it has value '3').
Deleting $input{c}.
Key: 'c', does not exist.
Expected results:
Key: 'a', does exist (yet it has value '1').
Deleting $input{a}.
Key: 'a', does not exist.
Key: 'b', does exist (yet it has value '2').
Deleting $input{b}.
Key: 'b', does not exist.
Key: 'c', does exist (yet it has value '3').
Deleting $input{c}.
Key: 'c', does not exist.
Additional info: The problem is line 1179 of CGI.pm, which currently reads:
exists $_[0]->{$_[1]};
but should be:
exists $_[0]->{param}{$_[1]};
(this bug was fixed by todd_lewis)