Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

digital1

macrumors 6502
Original poster
Jan 2, 2002
294
0
Wisconsin
:confused: I decided to start another thread. I actually got my problem solved from the last thread. I am trying to figure out how to do a drop-down in Perl using CGI.pm I can't find too many decent sources on doing this. Any ideas anyone?:confused:
 

hatter

macrumors newbie
Jan 15, 2006
8
4
Not really a mac question, so firstly I'd suggest looking at perlmonks.org for a great and helpful site for perl questions.

In answer to this specific question, the function you're looking for is
popup_menu() if you type 'perldoc CGI' in Terminal session, you'll find some examples, and the options available, but in essence it goes something like:

popup_menu(-name=>'color',-values=>['red','green','blue','chartreuse'], 'red')
 

epochblue

macrumors 68000
Aug 12, 2005
1,671
0
Nashville, TN
hatter said:
Not really a mac question, so firstly I'd suggest looking at perlmonks.org for a great and helpful site for perl questions.

In answer to this specific question, the function you're looking for is
popup_menu() if you type 'perldoc CGI' in Terminal session, you'll find some examples, and the options available, but in essence it goes something like:

popup_menu(-name=>'color',-values=>['red','green','blue','chartreuse'], 'red')


This is correct - but make sure you download and install the CGI CPAN module, and include it in your scripte/module with "use CGI;"

If you want perl to download an install the CPAN module itself, use this command (to be run from the command line):

perl -MCPAN -e 'install Module::Name'

Make sure you run it as root, and if it's the first time you've run this command, you'll have some setting up to do...the defaults are usually okay.

Oh - and that command is generic, your specific command will look like this:

perl -MCPAN -e 'install CGI';
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.