我怎样才能获得 PHP 的(部署)简单但 Perl 的强大功能? [英] How can I get PHP's (deployment) simplicity but Perl's power?

查看:40
本文介绍了我怎样才能获得 PHP 的(部署)简单但 Perl 的强大功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我鄙视 PHP 语言,而且我很确定我并不孤单.但是 PHP 的伟大之处在于 mod_php 采取并隐藏了与 apache 运行时集成的血腥细节的方式,并实现了类似 CGI 的请求隔离和不错的性能.

I despise the PHP language, and I'm quite certain that I'm not alone. But the great thing about PHP is the way that mod_php takes and hides the gory details of integrating with the apache runtime, and achieves CGI-like request isolation and decent performance.

使用 Perl 语义获得与 PHP 运行时环境相同的简单性、速度和隔离性的最短距离方法是什么?我觉得原始 mod_perl 给了我太多的束缚:交叉请求全局变量、凌乱的配置、太多的模板引擎可供选择.

What's the shortest-distance approach to getting the same simplicity, speed and isolation as PHP's runtime environment, with Perl semantics? I feel like raw mod_perl gives me too much rope to hang myself with: cross-request globals, messy config, too many template engines to choose from.

FastCGI?HTML::梅森?我想主要用 Perl 做开发,如果我有一个框架让我做就好了.

FastCGI? HTML::Mason? I'd like to do development largely in Perl, if only I had a framework that let me.

推荐答案

Catalyst 这个MVC(模型、视图、控制器)框架独立工作或与 apache_perl 一起工作,并隐藏了很多杂乱的部分.有一个稍微奇怪的学习曲线(快速开始,中间较慢,然后它真的可以点击高级内容).

Look at Catalyst this MVC (model, view, controller) framework works stand-a-lone or with apache_perl and hides a lot of the messy bits. There is a slightly odd learning curve (quick start, slower middle, then it really clicks for advanced stuff).

Catalyst 允许您使用 Template Toolkit 将设计逻辑与业务分离逻辑上,模板工具包真的很棒,即使您决定不使用 Catalyst,也应该使用它.HTML::Mason 不是我个人喜欢的东西,尽管如果您自己完成所有 HTML,那么您可能需要查看 Template::Declare 这是另一种可以与 Catalyst 一起使用的替代方法.

Catalyst allows you to use Template Toolkit to separate the design logic from the business logic, Template toolkit really is great, even if you decide not to use Catalyst then you should be using this. HTML::Mason isn't something I personally like, although if you do all the HTML yourself then you might want to review Template::Declare which is another alternative you can also use with Catalyst.

有关数据库内容,请查看 DBIx::Class,它再次与 Catalyst 一起使用或单独使用.

For database stuff look at DBIx::Class, which yet again works with Catalyst or on it's own.

这篇关于我怎样才能获得 PHP 的(部署)简单但 Perl 的强大功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆