Subject: | Multiple calls to parse_form_data multiply values |
[I'm not sure if it's a bug, or projected behaviour]
If I call parse_form_data function twice, I'm getting results as if I passed multiple values for the same variable:
#!/usr/bin/perl -w
use CGI::Lite;
use Data::Dumper;
$q=new CGI::Lite;
$form=$q->parse_form_data;
$form2=$q->parse_form_data;
print "Content-type: text/html\n\n";
print "<pre>".Dumper($form2)."</pre>";
Testing with
wget http://localhost/cgi-bin/test.cgi?foo=bar
yields result:
$VAR1 = {
'foo' => [
'bar',
'bar'
]
};
If you consider it a bug, then, I think, problem lies in Lite.pm:947 -
push (@{ $self->{web_data}->{$key} }, $value);
Or, rather in not clearing web_data var before parsing the form data.
Thank you,
Elena Khrissanova