|Keep It Simple, Stupid
CGI:Application and HTML::Template parameter passingby emgrasso (Novice)
|on Sep 02, 2007 at 19:54 UTC
emgrasso has asked for the wisdom of the Perl Monks concerning the following question:
I am just learning CGI::Application. My first app is based closely on some examples I have found online, including http://www.sitepoint.com/article/cgi-application/1.
There is something very basic that I seem to be missing about passing information back and forth. I have verified that the sitepoint example works correctly in my environment and tweaked my code to be as similar to it as possible.
One of my templates ends with the lines:
Note that the <tmpl_var name=userid> displays the value of userid so I'm sure it is what I think it should be: 0 or the userid of the record that is being edited.
The maintain_user runmode looks like:
My problem is that $q->param('userid') seems to be always coming back empty, so the script always takes the create_user branch.
Devpopup shows incoming HTTP_REFERER http://localhost/cgi-bin/IncentivePoints.cgi/IncentivePoints.cgi?rm=admin_edit_user&userid=test3 and outgoing QUERY_STRING rm=admin_edit_user&userid=test3.
Is there a better way to do the parameter passing? Or a good way to debug the problem?
Or can anyone suggest what might be going wrong?