Freelancer has asked for the wisdom of the Perl Monks concerning the following question:

I have only been delving in to perl for the past 3 months and have come unstuck whilst trying to access the value from a drop down in a form. Basically my form has a number of items, with a value associated to each item and I need to be able to determine what the value is according to which item from the list has been selected. Any help or pointers would be greatly appreciated. TIA

Replies are listed 'Best First'.
Re: Drop Downs
by Cabrion (Friar) on Feb 07, 2003 at 11:24 UTC
    Assuming your HTML is correct and your drop down has a UNIQUE "name" attribute:
    use CGI; my $c = new CGI; my $value = $c->param('drop_down_name'); ....
    In the more general sense, you need to explore perl's CGI module. Perhaps a book on the subject if you are so inclined.
Re: Drop Downs
by bassplayer (Monsignor) on Feb 07, 2003 at 23:40 UTC
    Freelancer,

    You will receive more useful responses to your postings if you include your code (in this case HTML and Perl), and what things you've tried to solve your problem. Here's a node that can be quite helpful.

    Cabrion's answer should be exactly what you need and don't forget to use strict.

    Oh, and welcome to the Monastery.

    bassplayer