3

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

4
  • 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? Commented Oct 30, 2012 at 13:15
  • @itsbruce, as tags shows Apache Commented Oct 30, 2012 at 13:20
  • 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 assumption Commented Oct 30, 2012 at 13:38
  • Belated, I know...but at that point you would see that the question was edited. I see no edit links. Commented Jul 27, 2014 at 20:23

3 Answers 3

5

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.

Sign up to request clarification or add additional context in comments.

Comments

4

yes, with the Action directive:

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

4 Comments

I'm talking about the web server (apache) ! not terminal run.
@4r1y4n I guessed that, but you should have said that clearly in your question.
I said that ("web server")! and in question tags there are apache & module; anyway thanks
Should I load mod_perl for this solution too?
2

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.