More Perl fun-CGI fun now.

Discussion in 'Mac Programming' started by digital1, May 18, 2006.

  1. macrumors 6502

    digital1

    Joined:
    Jan 2, 2002
    Location:
    Wisconsin
    #1
    :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:
     
  2. macrumors newbie

    Joined:
    Jan 15, 2006
    #2
    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')
     
  3. macrumors 68000

    epochblue

    Joined:
    Aug 12, 2005
    Location:
    Nashville, TN
    #3

    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';
     

Share This Page