I'm working for the first time on saving state to a file based on Lincoln
Stein's example and I'm having problems. Test code excerpts are
below. save_state() is successfully creating and writing a file in the
STATES directory holding several keyword=value pairs. The problem is when
I restore, the only thing that I receive back is the literal
'keywords'. Why am I not receiving my keyword=value pairs? What am I
doing wrong?
fetch_old_state($session_key);
my $test = url_param('test');
print "test = $test\n"; #This statement only prints "test = "
my @names = url_param();
print "@names\n"; #This statements only prints "keywords"
print $ENV{QUERY_STRING}; #This statement prints nothing
sub fetch_old_state {
my $session_key = shift;
open(SAVEDSTATE,"$STATE_DIR/$session_key") || return;
$q->restore_parameters(\*SAVEDSTATE);
close SAVEDSTATE;
}
sub save_state {
my($session_key) = @_;
open(SAVEDSTATE,">$STATE_DIR/$session_key") ||
die "Failed opening session state file: $!";
$q->save(\*SAVEDSTATE);
close SAVEDSTATE;
}
-Mike
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]