http://www.perlmonks.org?node_id=11190
chromatic has asked for the wisdom of the Perl Monks concerning the following question:

Hi, One of the core Jellybean objects uses CGI.pm to pull data from the QUERY_STRING. (We're good monks.) Since Jellybean offers a persistent object platform, we ran into an issue where the values from CGI::param() didn't match the query string passed from the client.

For example, the following code is a snippet showing the behavior. The print statements are for debugging, and I'll describe the commented bits after the code:

sub save { my $self = shift; print STDERR $ENV{QUERY_STRING}, "\n"; # $CGI::PERLEX = 1; my $q = new CGI; my $result; foreach my $sect ($self->{config}->sectionNames()) { foreach my $item ($self->{config}->sectionKeys($sect)) { print STDERR "Found:\t", $q->param("$sect|$item"), "\n"; $self->{config}->put($item, $q->param("$sect|$item"), $sec +t); } } # $q->_reset_globals(); if (!$self->{config}->save()) { return "Error saving config file: $!"; } else { return $self->default(); } }
From my brief perusal of CGI.pm, am I correct in assuming that there is something in its namespace that ought to be reset? Either of the two commented out lines achieve the same results -- namely, that it works properly.

Anyone with more CGI.pm familiarity is invited to comment on this, especially if you can provide insight or a better way to do things.