In one page, inside a form, you can have a hidden field of the form
<input type="hidden" name="thing" value="$thing">
and the script invoked by the form then gets the value by
using
param (using CGI.pm, of course), i.e.
$thing=param('thing')
You can use CGI.pm to produce the code for the hidden field
using something like
print hidden(-name=>"thing1",-value=>"thing2");
but I seem to recall having difficulty getting variables
to interpolate in the value, so I've usually used the explicit first way. (If someone can comment on the interpolation problem, I'd be happy to hear about that...)
The CGI module has built-in handling of "stickiness" (i.e.
maintaining state (and I believe this makes use of hidden fields in a clever way... I don't understand it very well)) but it usually takes me such a lot of
messing around to get it to work properly that I mostly
just use hidden fields myself. That's not meant to detract
from CGI.pm at all - it is a wonderful tool, I just don't
know it well enough. (I always use CGI.pm, I just don't
always use all of the subtleties available.)
chas
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.