in reply to Drop Down Year List

Well I finally got this to work. My problem was that, instead of "printing" the menu, I needed to "return" it and then call it with a placeholder on the html page (I apologize if that's not the proper terminology). Here's what I have:

sub make_year_range_html { my $year = 1900 + (localtime)[5]; my $html = qq{<select name="CC_ExpDate_Year">\n}; $html .= qq{<option value="" selected>--</option>\n}; for my $ccy ($year .. $year + 9) { $html .= qq{<option value="$ccy">$ccy</option>\n}; } $html .= qq{</select>\n}; return $html; }

Next, I created the placeholder with this code:

$main::global->{form}->{year_range} = make_year_range_html();

Then I put the placeholder on the html page, like so:

<! year_range>

It works perfectly! Thanks to everyone who helped me with this. This has taught me a lot about how Perl works in a cgi environment, especially how to create sub routines and using the output with placeholders. Exciting stuff!

Ted