After searching both google and perlmonk's I've come up pretty light on results concerning my dilemma. Now when you use CGI::Application::Plugin::ValidateRM there are several ways to implement this. You can have what I would call a 3 method system. The first method to display the form, another to process the form, and lastly one for your form's profile. I've also seen it implemented in one runmode. Is there a best practice to this? Are you better off storing your profile in a variable then its own method? Does this even matter (in the scope of scalability/memory usage) Is mod_perl a factor?

To start I'm using strict, warnings, apache, mod_perl, and taint mode. So I have a list of users, then actions (url driven). I.E. user1 edit myapp.pl?rm=edit&user=1. Etc you get the point. So you click and the edit runmode goes off without a hitch, and it understands that your editing user 1. Now in the template that displays edit comes lots of the "best practices" part of my question. So to make this more clear we have display_form and process_form (from the doc example). The display_form presents the form and has a hidden field name=rm value=process_form for the runmode to process that form. Now the behavior of this is interesting because it more or less keeps the magic hidden from the user (from the url bar its not evident that your using a different runmode, at least for me), or you can method=post action=?rm=process_form which breaks up the url and makes it evident your using a new runmode.

Now my second problem is that regardless of how hard I try I cannot get that initial user query,variable whatever to be persistent between methods. Making a Query object and trying to $q->param('user') or die; in process_form dies with a particularly useless error message. Shoving $q->param('user') into $myapp->param('user') in the display_form method fails to hand off in process_form. In all the examples the query data is happily persistent between methods/runmodes, a behavior that I can't seem to replicate. Now you may say to use sessions, fine, then my question to you is "I'm using CGI::Application::Plugin::Authentication which uses a session to check if your logged in, do I create another?" I haven’t been able to access the CGI::Application::Plugin::Authentication generated session yet, but I could just make another but I figured that its somehow sloppy to create two sessions for one user.

Now I understand that there is not always a "right" way to do things, but there is a secure way of doing this and a fast way of doing things. So I seek the advice of those wiser then I to advise me on my problem and thanks for reading the tome.


In reply to Life, Love and CGI::Application::Plugin::ValidateRM (and Friends) by novastorm0

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.