#!/usr/bin/env perl

use strict;
print "Content-Type: text/html;\n\n";
print<<"EOF";
<html>
<head>
<title>Installed Module List</title>
</head>
<body>
<div style="border: 1px solid #ccc">
    <br>
    ■CPANモジュールインストール方法<br>
    <br>
    \$ sudo perl -MCPAN -e shell<br>
    cpan> install <u>Module-Name</u>
</div>
EOF
print "<ul>\n";
print qq|<li><a href="http://search.cpan.org/search?module=$_">$_</a></li>\n|
    for sort
    map {$_ =~ m/^.+?"Module" (.+?)$/}
    qx/perldoc perllocal/;
print "</ul>\n";

print<<"EOF";

</body>
</html>
EOF
