Hi Kevin
You need to pass in your values as a hash reference, i.e.
print $CGI->popup_menu(-name=>'menu_name',
-values=>\%menu_values);
By the way, I don't know if you're aware, but this list supports the
CGI::Application web development framework not CGI applications in general.
People here are still quite helpful, but you may find perlmonks.org as the
best place for general Perl questions
Dan
_____
From: Kevin Mullin [mailto:suppressed
Sent: Sunday, 21 January 2007 8:42 a.m.
To: suppressed
Subject: [cgiapp] CGI.pm help
Is this the right mailing list to ask these kinds of questions?
I'm having problems with the popup_menu CGP.pm method. I have it working
with code that looks like this:
print $CGI->popup_menu(-name=>'menu_name',
-values=>('eenie'=>'one',
'meenie'=>'two',
'minie'=>'three'));
wher CGI is the CGI.pm object created before with $CGI = new CGI;
The above works just fine. Then, I tried to create a hash with the values
I'm giving to popup_menu (which the books says I can do) with this code:
%menu_values = ('eenie'=>'one',
'meenie'=>'two',
'minie'=>'three');
print $CGI->popup_menu(-name=>'menu_name',
-values=>%menu_values);
But when this is run from my web browser, I see the code it generates is:
<select name="menu_name" three="meenie" one="minie" two>
<option value="eenie">eenie</option>
</select>
Which, of course, doesn't work. What am I doing wrong?
Kevin Mullin
Sr. Analyst
IBM Corporation
(206) 345-7068
suppressed <http://www.ibm.com/ibm/values/>
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.