SPUG: cgi method popup_menu

B.Ingerson at epixtech.com B.Ingerson at epixtech.com
Tue May 16 17:16:04 CDT 2000



FYI,

popup_menu(-name=>'foo',
           -values => \@foo,
           -override => 'force',
          )

This will override the sticky pop-up feature.

Brian






lorraine at nw.saic.com (Lorraine Johnson)@pm.org on 05/16/2000 01:31:24 PM

Sent by:  owner-spug-list at pm.org


To:   spug-list at pm.org
cc:

Subject:  Re: SPUG: cgi method popup_menu


Bill,

I'm sorry, but I haven't been using Perl long, and so I'm not sure I follow
what you are saying.  If you have two instances of the same variable *name*
(say, $myvar and @myvar) they're still not the same *variable*.  I think
Joe is (sort-of) writing to the same *variable* with the repeated calls to
popup_menu.  (Corrections gladly accepted!)

I recently replaced a Unix Web server with an NT box and needed to either
translate some old C CGI into Windows (ack!) or learn another language.  I
went with Perl since there is so much information available.  I've been
working with the CGI.pm module as it is highly recommended and easy to use.
 No regrets so far!

The module has a feature where the form elements are "sticky" (Stein's
word) so that they are remembered from one invocation to the next (sounds
odd, but it works).  It seems to me that Joe's difficulty is an unexpected
side effect of this feature.  But there's a method in the madness.  With
the sticky form elements, you can validate a user's input and, if
anything's missing, redisplay the (partially-filled-out) form and prompt
for the missing info without the awkwardness of saying "use your back
button and fix x, y, or z."  It also enables you to do multi-page forms,
where a subsequent form presented to the user may depend on earlier input
(see http://www.wiley.com/compbooks/stein/source.html "loan.pl: Multi-page
questionnaire (listing 2.3, page 70)").

Lorraine

At 11:21 AM 5/16/00 -0700, Bill Campbell wrote:
>I haven't tried this, but I have used cgi scripts that return multiple
>instances of the same variable name.  These are ancient scripts that date
>well before the perl CGI modules so I'm parsing the input myself.  I
create
>two perl variables for each name on the input, a scalar that contains the
>last setting, and an array containing all entries.  I've hacked getopt.pl
>to do the same thing with $opt_? and @opt_? which I did originally for a
>front-end to groff where multiple -r options are common.
>
>There are places where having an array of variables is useful.

...................................
J. Lorraine Johnson
SAIC/Sea Technology
lorraine at nw.saic.com
v: (425) 482-3316
f: (425) 485-5566
http://www.nw.saic.com

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
 Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/
 For Subscriptions, Email to majordomo at pm.org:  ACTION  spug-list  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email address






 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
 Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/
 For Subscriptions, Email to majordomo at pm.org:  ACTION  spug-list  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email address





More information about the spug-list mailing list