简体   繁体   English

运行perl脚本,如没有CGI的PHP

[英]Running perl scripts like php without CGI

Is it possible to run Perl script in web server without using CGI? 是否可以在不使用CGI的情况下在Web服务器中运行Perl脚本?
I mean, like php scripts (run any .pl file without #!/path/to/interpreter line). 我的意思是,像php脚本(运行没有#!/path/to/interpreter行的任何.pl文件)。
If Yes, How? 如果是,怎么样?

Thanks 谢谢

Take a look at PSGI/Plack . 看看PSGI / Plack It's Perl <--> web server without CGI. 这是没有CGI的Perl < - > Web服务器。

PSGI is an interface between Perl web applications and web servers, and Plack is a Perl module and toolkit that contains PSGI middleware, helpers and adapters to web servers. PSGI是Perl Web应用程序和Web服务器之间的接口,Plack是一个Perl模块和工具包,包含PSGI中间件,帮助程序和Web服务器适配器。

PSGI and Plack are inspired by Python's WSGI and Ruby's Rack. PSGI和Plack的灵感来自Python的WSGI和Ruby的Rack。

yes, with the Action directive: 是的,使用Action指令:

AddHandler perl-files .pl
Action perl-files /path/to/perl/interpreter

Yes. 是。 If you are using Apache, the canonical way to do this is to use mod_perl . 如果您使用的是Apache,那么执行此操作的规范方法是使用mod_perl

Note: mod_perl is more than just a Perl handler for Apache; 注意:mod_perl不仅仅是Apache的Perl处理程序; it provides a standard interface (and many helper functions) for communicating with the webserver. 它提供了一个标准接口(和许多辅助函数),用于与Web服务器通信。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM