}
my %scver = %{$requestver};
-my $datafile = "sc-units-$Request.inc.pl";
+my $datafile = "sc-units-$Request";
Html({
title => "$scver{title} unit cheat sheet",
],
stylesheet => [qw( light dark )],
raw => '<link rel="stylesheet" type="text/css" media="all" href="/sc.css?1.2">',
- data => [$datafile],
+ data => ["$datafile.inc.pl"],
});
say "<h1>$scver{game} units</h1>\n";
-my $units = do $datafile;
-Abort("Cannot open unit data", 501, $_) for $@ || $! || ();
+my $units = Data($datafile);
my $patch = shift @{$units}
or Abort("Cannot open unit data: metadata not found", 501);