Does somebody know a module which allows me to write a web-gui for my script (like the web-administration-tools from cups and samba) without installing/configuring/running a web-server analo开发者_JAVA技巧g to the DBD::SQLite where I can use a database without the need of a database-server.
Install module Plack then run your webserver
plackup --listen localhost:80 --loader Shotgun -MPlack::App::WrapCGI -e " Plack::App::WrapCGI->new( script => q{test.cgi} ) "
HTTP::Server::PSGI: Accepting connections at http://localhost:80/
test.cgi is written the standard way (same as you would for apache cgi-bin) Shotgun means test.cgi will be reloaded each time you edit test.cgi
Use some microwebframework like Dancer
or Mojolicious
Dancer example (including simple webserver):
#!/usr/bin/perl
use Dancer;
get '/hello/:name' => sub {
return "Why, hello there " . params->{name};
};
dance;
Write a Plack application. Bundle it with one of the supported stand-alone servers, e.g. HTTP::Server::Simple.
You would need to embed a webserver (or something that at least understood basic HTTP) into add code to your application that listened on a TCP port and serviced basic HTTP requests.
A quick google found this article/tutorial that should get you started:
http://www.perl.com/pub/2002/09/17/ewispp.html
(Edited in an attempt to avoid confusion around "embedding a webserver")
精彩评论