Mailing List Archive

which framework is best suitable for modperl?
Though I have written several handlers using mp2, but for further web
development under modperl, what framework do you suggest to go with?

(I have few experience on Dancer, which I don't think work together with
MP).

thanks.
Re: which framework is best suitable for modperl? [ In reply to ]
On 16-07-19 11:55 PM, yhpeng@orange.fr wrote:
> Though I have written several handlers using mp2, but for further web
> development under modperl, what framework do you suggest to go with?
>
> (I have few experience on Dancer, which I don't think work together with
> MP).
>
> thanks.

Anything built on top of plack (including Dancer) can be run under
mod_perl using Plack::Handler::Apache2, so it's really up to whatever
your personal preference is.

docs on how to run Dancer under mod_perl can be found here:
http://search.cpan.org/dist/Dancer/lib/Dancer/Deployment.pod#Running_from_Apache_with_Plack

That said, any framework you use isn't *really* going to leverage
mod_perl, as they are all design to just run during the response phase
of the apache request processing cycle. It's through leveraging that the
mod_perl's power really shines. You can read more about what I'm talking
about here:

https://perl.apache.org/docs/2.0/user/handlers/http.html

Adam
Re: which framework is best suitable for modperl? [ In reply to ]
On Wed, 20 Jul 2016 11:55:24 +0800
yhpeng@orange.fr wrote:

> Though I have written several handlers using mp2, but for further web
> development under modperl, what framework do you suggest to go with?

Q: What do you mean by "framework"?

> (I have few experience on Dancer, which I don't think work together
> with MP).

Frankly, you are better off with Plack and PSGI (a.k.a. Dancer,
Dancer2, twiggy, etc) than trying to embed anything into apache
with mod_perl. There are modules for converting mod_perl request
objects into plack, which simplifies all of your code and makes
debugging it a whole lot easier (since you can use perl -d
rather than dealing with mock apache objects).

If you have to run code w/in apache then try the PSGI interface:

<https://github.com/spiritloose/mod_psgi/>

You can test the code with perl -d and run it in anything from
twiggy to starman to apache when you are done.

--
Steven Lembark 3646 Flora Pl
Workhorse Computing St Louis, MO 63110
lembark@wrkhors.com +1 888 359 3508
Re: which framework is best suitable for modperl? [ In reply to ]
On 7/20/2016 4:04 PM, Steven Lembark wrote:
> On Wed, 20 Jul 2016 11:55:24 +0800
> yhpeng@orange.fr wrote:
>
>> Though I have written several handlers using mp2, but for further web
>> development under modperl, what framework do you suggest to go with?
> Q: What do you mean by "framework"?
>
>> (I have few experience on Dancer, which I don't think work together
>> with MP).
> Frankly, you are better off with Plack and PSGI (a.k.a. Dancer,
> Dancer2, twiggy, etc) than trying to embed anything into apache
> with mod_perl. There are modules for converting mod_perl request
> objects into plack, which simplifies all of your code and makes
> debugging it a whole lot easier (since you can use perl -d
> rather than dealing with mock apache objects).
That isn't the case if you make use of all the nice features of mod_perl
then
there just isn't the support in Plack to do the same thing - you can do
really
nasty coding to get round some of it (and it is nasty).
You don't have the same flexibility in turning on and off phases like you do
in mod_perl - and so you end up with having multiple layers of plack
objects - which adds to inefficiency...
But when it comes to output filters and the like then there really isn't an
equivalent in Plack to achieve the same flexibility...

We have applications in perl, javascript (node), java and php which are
hooking into the request phase of a perl server but are wrapped with
mod_perl layers to achieve templating security etc. It is not quick and
easy to do this with Plack in quite as seemless away.

We have also noticed performance issues with many of the Plack
implementations
they are great when the traffic is low - but unless you run under mod_perl -
they don't tend to cope with large (heavy request) traffic as well as
mod_perl.

this


>
> If you have to run code w/in apache then try the PSGI interface:
>
> <https://github.com/spiritloose/mod_psgi/>
>
> You can test the code with perl -d and run it in anything from
> twiggy to starman to apache when you are done.
>



--
The Wellcome Trust Sanger Institute is operated by Genome Research
Limited, a charity registered in England with number 1021457 and a
company registered in England with number 2742969, whose registered
office is 215 Euston Road, London, NW1 2BE.