Monks,
I must confess: I wasn't sure if this should go under SOPW, PD or Meditations, but here it is anyway.
In writing a web application (for my wife of all people) to manage a list of contacts for a dog club that I belong to. The technique that I use in designing my web applications in Perl is to use a central script that dispatches to various OO modules that contain the functionality I am after. A CGI parameter that gets carried between executions of the central script is a parmeter called "Action" that tells the central script what to do next.
Often times I use hidden fields to carry the value of Action and other times I use submit buttons to "jam" the value.
While debugging my application I got into a situation where the next action was not being executed. I started to dig into it and discovered something wierd. Here is a sniglet of the code that I was using:
A simplified version of the resultant HTML looked like:use CGI qw/ :all /; . . . print start_form(-action=>'/cgi-bin/mycgi.pl'); print table( Tr( td(submit (-name=> "Action", -value=> "Insert Next" ) ) ) ); print end_form; # # The above is an oversimplification, but enough to get # the point accross (I hope!) #
| <hidden name="Action" value="lastAction"/> <submit name="Action" value="insertNext"> |
Now: what I want to know is was I smoking too much crack that day or has anybody else seen this sort of odd behavior.
I was able to fix the issue but invoking $cgi->delete_all prior to building the new form.
Peter @ Berghold . Net
Sieze the cow! Bite the day!
Test the code? We don't need to test no stinkin' code! All code posted here is as is where is unless otherwise stated.
Brewer of Belgian style Ales
In reply to Odd CGI.pm behavior. by blue_cowdawg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |