3
votes

Is it possible to run Perl script in web server without using CGI?
I mean, like php scripts (run any .pl file without #!/path/to/interpreter line).
If Yes, How?

Thanks

3
You haven't given quite enough context in your question; it's only from your comment below that it's absolutely clear you want to do this in a webserver context. Which webserver are you using?itsbruce
@itsbruce, as tags shows ApacheAriyan
It is not safe to rely on tags with no other context; they may have been added by somebody else, who may have made an incorrect assumptionitsbruce
Belated, I know...but at that point you would see that the question was edited. I see no edit links.Justin E

3 Answers

5
votes

Take a look at PSGI/Plack. It's Perl <--> web server without CGI.

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 and Plack are inspired by Python's WSGI and Ruby's Rack.

4
votes

yes, with the Action directive:

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

Yes. If you are using Apache, the canonical way to do this is to use mod_perl.

Note: mod_perl is more than just a Perl handler for Apache; it provides a standard interface (and many helper functions) for communicating with the webserver.