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:
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.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(); } }
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.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: CGI.pm Caching Issue
by btrott (Parson) on May 11, 2000 at 21:54 UTC | |
by takshaka (Friar) on May 12, 2000 at 00:55 UTC | |
by chromatic (Archbishop) on May 12, 2000 at 01:43 UTC | |
by takshaka (Friar) on May 12, 2000 at 03:55 UTC | |
Re: CGI.pm Caching Issue
by cei (Monk) on May 11, 2000 at 22:30 UTC |
Back to
Seekers of Perl Wisdom