<(common.inc.plp)><:
my ($name) = $Request ? $Request =~ m{\A(\w+)} : 'finder';
my $page = "word/$name.plp";
if (-e $page) {
utf8::downgrade($page);
Include $page;
}
elsif (-e "word/$name.js") {
Html({
raw => join("\n",
(map {qq(<script src="/word/$_"></script>)}
'put.min.js', 'quiz.js', "$name.js",
),
(map {qq(<link rel="stylesheet" type="text/css" href="/$_">)}
grep {-e} "word/$name.css"
),
),
});
say '<h1>Words</h1>';
say '<section id="quiz"></section>';
say "<script>new Word\u$name()</script>";
}
else {
Html();
say '<h1>Words</h1>';
die ["Page <q>$name</q> not found"];
}