Quote
sub html_selection {
print "<select name='Installationen'>\n";
for (sort(keys(%software))) {
if (&is_in($_, @installed)) {
print "<option selected>$software{$_}</option>\n";
} else {
print "<option>$software{$_}</option>\n";
}
}
print "</select>\n";
}
Das kann man ganz elegant mit CGI machen:
Bsp.:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use CGI qw/:all/;
my %software = qw/ldms LanDeskManagement sap SAP_GUI_6.2 notes LotusNotes/;
my @installed = qw/ldms notes/;
my $select = scrolling_list(-name=>'Installationen',
-multiple=>1,
-values=>[sort keys %software],
-default=>[@installed],
-labels=>\%software
);
print $select;
_ _ END _ _
<select name="Installationen" size="3" multiple="multiple">
<option selected="selected" value="ldms">LanDeskManagement</option>
<option selected="selected" value="notes">LotusNotes</option>
<option value="sap">SAP_GUI_6.2</option>
</select>
Gibts noch viel mehr geile Sache in perldoc CGI.
Man muss es nur nutzen ;)
Gruß Alex