or Html(), Abort("Requested version <q>$Request</q> not available", '404 request not found');
if (ref $requestver ne 'HASH') {
- $header{Location} = $requestver;
+ $header{Location} = "/sc/$requestver";
Abort("Canonical URL for $Request is at $requestver", '302 subpage alias');
}
my %scver = %{$requestver};
-my $datafile = "sc-units-$Request.inc.pl";
+my $datafile = "sc-units-$Request";
Html({
title => "$scver{title} unit cheat sheet",
- version => '1.2',
+ version => '1.3',
description => [
"Reference of $scver{game} unit properties,"
. " comparing various statistics of all the units in $scver{name}"
],
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);