hi guys it's really getting me confused with cgi object's save_param method. It seems that a group of checkboxes value won't get saved for the 2nd time. I have a complete example here and hope you guys can help point out what i'm doing wrong :

test1.pl :
#!/usr/bin/perl print "content-type: text/html \n\n"; use strict; use warnings; use CGI; use CGI::Session qw/-ip-match/; my $cgi = new CGI; my $session; if($cgi->param("failed")){ $session = CGI::Session->load($cgi->param("sessionid")); $session->load_param($cgi); }else{ $session = new CGI::Session(); } my $sessionid = $session->id(); print<<output; <html> <body> previously selected : output my @keywords = $cgi->param("person"); foreach my $x(@keywords){ print "($x)\n"; } print<<output; <form action="process.pl" method="post"> <INPUT TYPE="hidden" NAME="sessionid" VALUE="$sessionid"/> <input type="checkbox" name="person" value="1"/>Alex <input type="checkbox" name="person" value="2"/>Robin Hood <input type="checkbox" name="person" value="3"/>Batman <input type="submit"/> </form> </body> </html> output
process.pl :
#!/usr/bin/perl use strict; use warnings; use CGI; use CGI::Session qw/-ip-match/; # instantiate a new CGI object my $cgi = new CGI; my $sessionid = $cgi->param("sessionid"); my $proceedFlag = 0; my $session = CGI::Session->load($sessionid); open(LOGFILE, ">>log.txt"); print LOGFILE "gonna save cgi person as : ". $cgi->param("person") +."\n"; close LOGFILE; $session->save_param($cgi); if($proceedFlag){ print $cgi->redirect( -URL => 'test2.pl?sessionid='.$sessi +onid); }else{ # return to previous page with its session print $cgi->redirect( -URL => 'test1.pl?sessionid='.$sessi +onid."&failed=1"); }

In reply to could it be save_param bug? by adrive

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.