in reply to Drop Down Year List

I'm not sure if this is what you want...
#!/usr/bin/perl use strict; my $year = 1900 + (localtime)[5]; print qq{<select name="year">\n}; for ( my $i = $year; $i <= $year + 9; $i++ ) { print qq{<option value="$i">$i</option>\n}; } print qq{</select>};
Output:
<select name="year"> <option value="2009">2009</option> <option value="2010">2010</option> <option value="2011">2011</option> <option value="2012">2012</option> <option value="2013">2013</option> <option value="2014">2014</option> <option value="2015">2015</option> <option value="2016">2016</option> <option value="2017">2017</option> <option value="2018">2018</option> </select>

Replies are listed 'Best First'.
Re^2: Drop Down Year List
by tedspinkle (Novice) on Aug 21, 2009 at 00:41 UTC

    Thanks to both of you for the super fast response! The page that I want to display the option list on is not a Perl page. It's an HTML page with proprietary perl tags for the cart. So could this code be converted to a function or something and called on that page with a tag like <! year>?

    I apologize that my Perl is still so bad. =:\