One way to hide the checkboxes is to use a <span>
tag:
use strict;
use warnings;
use CGI;
my $q = CGI->new;
print $q->header;
print $q->start_html(-title => 'Test');
my @server = $q->param('sel');
if (!@server) {
print $q->p('please select a checkbox');
print $q->end_html();
exit;
} else {
print $q->start_form(-method => "POST",
-action => "next.pl",
-id => "sel");
print $q->span({hidden=>1},
$q->checkbox_group(-name => "DEL",
-values => \@server,
-default => \@server,
));
print $q->submit(-name => "submit",
-value => "Kill");
print $q->end_form();
print $q->end_html();
}
I do prefer using the HTML building methods that CGI.pm provides. Helps to keep HTML out of the Perl.