I found a strange behaviour in a CGI::Application-based app. I use  cgiapp_prerun to call my storage methods from the previous page. If a new whatever gets stored (rather than performing an update on the "whatever") I need that ID ( a mysql_insertid on the next page of the application.

I've tried setting the new ID in the CGI object (via  $self->query->param( -name = 'whatever', -value => 123);, but between the sub-object call and the run_mode call, the parameter isn't set.

I've tried setting the same "whatever" as a CGI::App param (using $self->param( 'whatever', 123 );) to no avail also.

I'd think that CGI::App uses a singleton appoach for the CGI (and HTML::Template) would be used, and when I've examined the code previously my opinion is supported. I've looked at the stringified reference string for the CGI object, and it looks the same.

Why wouldn't I be getting the "whatever" parameter in the runmode?


In reply to CGI::Application, the cgiapp_prerun mode, and CGI object interaction by geektron

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.