ikkon has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w BEGIN { use CGI::Carp qw(carpout); open(\*MYLOG, '>>', "sessions.log") or die("Unable to open perl.log: $!\n\n"); carpout(MYLOG); } use CGI; use CGI::Session; use strict; my $q = new CGI; print $q->header( "text/html" ); my %valueHash; GrabParams(); my $session = new CGI::Session(undef, undef, {Directory=>'tmp/sessions +'}) or die CGI::Session->errstr; my %newHash = $session->param('valueHash'); %newHash .= \%valueHash; foreach(%newHash){ print $_."<br>"; } $session->param('valueHash', \%valueHash); sub GrabParams{ my ( $paramName, $paramValue); foreach $paramName ($q->param) { foreach $paramValue ($q->param( $paramName )) { $valueHash{ $paramName } = pack 'U0A*', $paramValue; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using Sessions to save Parameters
by Joost (Canon) on Jul 31, 2007 at 19:11 UTC | |
|
Re: Using Sessions to save Parameters
by Corion (Patriarch) on Jul 31, 2007 at 18:33 UTC | |
by ikkon (Monk) on Jul 31, 2007 at 18:36 UTC | |
|
Re: Using Sessions to save Parameters
by ikkon (Monk) on Aug 01, 2007 at 14:11 UTC | |
by Joost (Canon) on Aug 01, 2007 at 18:14 UTC | |
|
Re: Using Sessions to save Parameters
by ikkon (Monk) on Aug 02, 2007 at 14:19 UTC |