my @data = (
[ Gender => [ 'Male', 'Female'] ],
[ A => [ 'a', 'b', 'c'] ],
);
####
for (@data) {
my ($column, $options) = @$_;
print $column . ': ';
foreach my $option (@$options) {
print ' ' . $option . ' ';
}
}
####
printf qq{%s\n},
$column,
$option,
$option
;
####
use strict;
use CGI;
my $q = CGI::->new;
my @data = (
[ Gender => [ 'Male', 'Female'] ],
[ A => [ 'a', 'b', 'c'] ],
);
for (@data) {
my ($column, $options) = @$_;
print $q->radio_group(
-name => $column,
-values => $options,
-default => '_',
);
# '_' is chosen as default as that will make
# no value checked by default, as long as you
# don't have '_' as an option.
}
####
my %dataoptions = map @$_, @data;