This does it:
my @Head = ("Anv. ID", "F\xF6r", "Efter", "Pref", "Bef", "Nytt", "Pr",
+ "F\xF6r", "Kap");
open my $temp, '<', $tempfil
or die "Kan inte \xF6ppna filen $tempfil";
print $qry->start_form(-action => "http://skinnmaskin/cgi-bin/kon.cgi"
+);
print $qry->table(
{ Border => 1, Cellpadding => 5, bordercolor =>"#FFFFFF" },
Tr(map { th($_) } @Head),
(map {
my ($Uid, $Fn, $En, $Pr, $Ank, $Ext, $Or, $Adr) = split m{[|]}
+;
Tr(
td(textfield('UID', $Uid, 6)),
td(textfield('FNA', $Fn, 20)),
td(textfield('ENA', $En, 35)),
td(textfield('PRE', $Pr, 10)),
td(textfield('BEF', $Ext, 16)),
td(textfield('NYTT', $Ank, 5)),
td(checkbox('')),
td(checkbox('')),
td(checkbox('')),
);
}
<$temp>), #/map
); #/table
Untested of course, as I don't have a copy of your input data. There are certainly better ways to do it (the HTML generation functions of CGI.pm are not how I'd go about generating HTML at all) but it sticks pretty closely to your original code.
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'