Perl製のコードは以下です。
#!/usr/bin/env perl
use strict;
use warnings;
use Mojolicious::Lite;
get '/rand' => sub { shift->render(template => 'rand', format => 'html') };
app->start;
__DATA__
@@ rand.html.ep
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<title>
ランダマイザー
</title>
</head>
<body>
<center>
<span style="font-size: 5vh;">
%srand;
%my @ab =('a','b');
%foreach my $i(1..10)
%{
%my $j = int(rand 2);
%my $k=sprintf("%02d",$i);
<%=$k%> : <%=$ab[$j]%> <br />
%}
<input type="button" value="もう1回" onclick="window.location.reload(true);" style="font-size: 3vh; WIDTH:25vw ; HEIGHT: 10vh"/>
</span>
</center>
</body>
</html>
@@ not_found.html.ep
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>
そのURLはコンテンツが存在しません。
</title>
</head>
<body>
<center>
<span style="font-size: 3vh;">
そのURLはコンテンツが存在しません。<br />
<a href="/">トップページに戻ってみてください。</a><br />
</span>
</center>
</body>
</html>
HTMLのテンプレートの中に、
・乱数の初期化
・配列の初期化
・foreachのループで10個のaまたはbを表示
というひねりはない感じのスクリプトです。
404の時に表示するエラー画面もおまけについてます。
なんやかんやでHTMLの方が多いですね。