非 Web 程序员的 Web 编程(Perl) [英] Web Programming For The Non-Web Programmer (in Perl)

查看:56
本文介绍了非 Web 程序员的 Web 编程(Perl)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望开始使用 Perl 进行 Web 编程(Perl 是我知道的唯一语言).问题是,除了上网之外,我对网络一无所知.我不知道从哪里开始.

I am looking to start Web Programming in Perl (Perl is the only language I know). The problem is, I have no prior knowledge of anything to do with the web, except surfing it. I have no idea where to start.

所以我的问题是...

我从哪里开始学习 Web 编程?我应该知道什么?我应该使用什么?

我提前感谢大家的回答和帮助.

I thank everybody in advance for answering and helping.

推荐答案

需要理解的关键是:

... 或者更确切地说,您打算发送给浏览器的内容,但了解其他内容是有用的(因为,特别是在复杂的 Web 应用程序中,您需要选择适当的数据格式).

… or rather, the things you intend to send to browsers, but having an awareness of what else is out there is useful (since, in complex web applications in particular, you will need to select appropriate data formats).

例如

  • HTML
  • CSS
  • JavaScript
  • 图片
  • JSON
  • XML
  • PDF

当您动态生成数据时,您还应该了解可用的工具(例如,Perl 社区非常喜欢 TT 用于生成 HTML,但还有其他选项,例如 Mason,而 JSON::Any 往往是我对 JSON 的首选.

When you are generating data dynamically, you should also understand the available tools (e.g. the Perl community has a strong preference for TT for generating HTML, but there are other options such as Mason, while JSON::Any tends to be my goto for JSON).

  • HTTP(包括使用什么状态代码以及何时使用、如何进行重定向、使用哪些方法(POST、GET、PUT 等)以及何时使用).
  • HTTPS(使用 SSL 加密的 HTTP)
  • PSGI/Plack 如果您想要现代和高效
  • CGI 非常简单
  • mod_perl 如果你想要疯狂的力量水平(我见过有人把 Apache HTTPD 变成了 SMTP垃圾邮件过滤器使用它).
  • PSGI/Plack if you want modern and efficient
  • CGI for very simple
  • mod_perl if you want crazy levels of power (I've seen someone turn then Apache HTTPD into an SMTP spam filter using it).

如何防范恶意输入(基本上归结为知道如何采取一种格式的数据(例如提交的表单数据)并将其转换为另一种格式(例如 HTML 或 SQL).

How to guard against malicious input (which basically comes down to knowing how to take data in one format (such as submitted form data) and convert it to another (such as HTML or SQL).

您可以将大量工作推给框架,它提供了组织网络应用程序的结构化方式.

You can push a lot of work off to frameworks, which provide structured ways to organise a web applications.

  • Web::Simple 很简单
  • Dancer 似乎站在中间立场(尽管我必须承认我没有机会使用它)
  • Catalyst 可能具有最陡峭的学习曲线,但具有很多功能和插件.
  • Web::Simple is simple
  • Dancer seems to be holding the middle ground (although I have to confess that I haven't had a chance to use it yet)
  • Catalyst probably has the steepest learning curve but comes with a lot of power and plugins.

这篇关于非 Web 程序员的 Web 编程(Perl)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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