kiat has asked for the wisdom of the Perl Monks concerning the following question:
I'm building an option list to be supplied as output to a template using HTML::Template (It's really cool - I just discovered. Thanks to bradcathey who helped with some sample code! (309583).
My code to build the list is as follows:
It works but I would like to know if there's a better way to do it.my $options = ''; while (my @ary = $sth->fetchrow_array()) { # $ary[0] holds the data's id # $ary[1] holds the data $options .= qq~<option value="$ary[0]">$ary[1]~; }
20031206 Edit by Corion: Changed link style to id://
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Concatenating a list...
by allolex (Curate) on Dec 06, 2003 at 17:27 UTC | |
|
Re: Concatenating a list...
by bradcathey (Prior) on Dec 06, 2003 at 17:23 UTC | |
|
Re: Concatenating a list...
by Anonymous Monk on Dec 06, 2003 at 15:38 UTC | |
by bradcathey (Prior) on Dec 06, 2003 at 17:44 UTC | |
by allolex (Curate) on Dec 06, 2003 at 21:42 UTC | |
|
Re: Concatenating a list...
by duff (Parson) on Dec 06, 2003 at 17:20 UTC |