使用 Perl 创建静态网站

将以下内容保存到名为 app.psgi 的文件中

#!/usr/bin/perl
use strict;
use warnings;

# Serve static files from document root with a directory index
# app.psgi
use Plack::App::Directory;
my $app = Plack::App::Directory->new({ 
                root => "/path/to/htdocs" 
            })->to_app;

然后运行

> plackup
> Accepting connections at http://0:5000/