Oh I see, you want us to write your code for you, without showing any effort on your part.....
For reasons which escape me...
#!/usr/bin/perl
use warnings;
use strict;
use CGI;
my $q = CGI->new;
print $q->header, $q->start_html(-title=>"Monkies");
my @options = qw/Macaque Proboscis Invisible Lemur/;
if($q->param("monkies")) {
print "It looks like you selected the following symian friends
+.<br />\n";
print join("<br />\n", $q->param("monkies"));
}
print $q->start_form;
print $q->popup_menu(-name=>"monkies", -values=>\@options, -multiple=>
+"multiple", -size=>"5");
print $q->submit(-value=>"Choose");
print $q->end_form;
print $q->end_html;
If there's anything there that you don't understand, I recommend checking
Ovid's
CGI course, and of course the manual for the lovely
CGI module.
Side note, you'd be better off using one of the
templating modules rather than CGI's methods for generating HTML, but that's just an opinion
davis
It's not easy to juggle a pregnant wife and a troubled child, but somehow I managed to fit in eight hours of TV a day.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.