J
Jason Carlton
I have a rather lengthy CGI script that I wrote about 5 years ago, but
it's still functional. At the very beginning, though, it connects to a
database, then loads several variables. It would be nice if these
could stay persistent.
Rather than rewriting the whole thing, I'm thinking that it might be
simpler to use SpeedyCGI to just keep a connection open to these
static variables.
Is there a way for me to empty certain variables on each run?
Specifically, I'd like to undefine params and cookies. I thought that
this would work, but it didn't:
# Parse params into @contents
undef @params;
undef @contents;
@params = param;
@contents{@params} = map param($_) => @params;
# Fetch cookies, $id = $cookies{'ID'}->value;
undef %cookies;
%cookies = fetch CGI::Cookie;
foreach $key (keys %cookies) { $cookies{$key} = $cookies{$key}-
TIA,
Jason
it's still functional. At the very beginning, though, it connects to a
database, then loads several variables. It would be nice if these
could stay persistent.
Rather than rewriting the whole thing, I'm thinking that it might be
simpler to use SpeedyCGI to just keep a connection open to these
static variables.
Is there a way for me to empty certain variables on each run?
Specifically, I'd like to undefine params and cookies. I thought that
this would work, but it didn't:
# Parse params into @contents
undef @params;
undef @contents;
@params = param;
@contents{@params} = map param($_) => @params;
# Fetch cookies, $id = $cookies{'ID'}->value;
undef %cookies;
%cookies = fetch CGI::Cookie;
foreach $key (keys %cookies) { $cookies{$key} = $cookies{$key}-
value; }
TIA,
Jason