in reply to Re: (jeffa) Re: Edit page with checkboxes
in thread Edit page with checkboxes

I think that was a fine solution to the problem. Why not use CGI.pm? And sure, there are many ways to tackle this problem - here is another that utilizes your ternary suggestion:
use strict; my @ss = ('SSD','PERS','SS','CHILD SUP'); my %checked = map {$_ => 1} ('SSD','PERS'); foreach my $ss (@ss) { print qq|<input type="checkbox" name="ss" value="$ss"|, $checked{$ss} ? ' selected' : '', ">\n" ; }
UPDATE:
Actually, @checked should be populated with something like the original:
my %checked = map {$_ => 1} split(/,/,$INPUT{'ss'})
But that point is moot (mu?) - use CGI.pm to handle form processing.

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)