Hi everyone, I recently started building a searchable website with perl. WIth the first script I create a subroutine that makes the forms (without frames) and I try to maintain state using the -action and -method statements. The next subroutine runs when a particular button has been pushed and creates frames, which should be filled out with 2 separate perl scripts. The problem is: when the frames are calling the perl scripts, state is not maintained. Is there any way of doing this (besides by saving and restoring state using "save(FH)" and "restore(FH)"? Here is the code:
my $CGI = new CGI(); #Create initial form &create_form($CGI) unless param(); #Get Action parm & go to appropriate subroutine my $action; if ($action = param('PDB')) { &show_pdb($CGI) } if ($action = param('RESULTS')) { &get_results($CGI) } #################subroutines sub create_form { my $query = shift; print $query->header("text/html"); print $query->start_html; print $query->start_form; print $query->p("Pick a PDB code\n"); print $query->popup_menu( -NAME=>'pdb', -VALUES=>\@keys, -DEFAULT=>" "); print $query->submit( -NAME=>'PDB', -LABEL=>'PDB info'); print $query->end_form; print $query->hr(); print $query->start_form(-method=>'POST', -action=>"./right2.p +l"); print $query->p("Pick a DOCK run to see the failures\n"); print $query->popup_menu( -NAME=>'results', -VALUES=>['DOCK4_FLEX_500', 'DOCK4_FLEX_5000', 'DOCK4_ +FLEX_50000']); print $query->submit( -NAME=>'RESULTS', -LABEL=>'Get results'); print $query->endform; print $query->hr(); print $query->end_html; } sub get_results { my $query = shift; print $query->header(); print $query->frameset({-cols=>'25%, 75%'}, frame({-name=>'left', -src=>"./left.pl", -method=>'POS +T'}), frame({-name=>'right', -src=>"./right2.pl", -action=>" +./right2.pl", -method=>'POST'}) ); }

In reply to CGI: frames & maintaining state across CGI scripts by TAS

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.