Web programming for a non-web programmer (in Perl)

I am looking to start web programming in Perl (Perl is the only language I know). The problem is that I do not have any prior knowledge of what is connected to the Internet other than surfing. I don’t know where to start.

So my question (s) ...

Where can I start learning web programming? What should I know? What should i use?

I thank everyone in advance for their reply and help.

+6
source share
3 answers

Key points to understand are:

What can you send to browsers

... or rather, what you intend to send to browsers, but knowing what else is there is useful (because in complex web applications, in particular, you need to choose the appropriate data formats).

eg.

  • HTML
  • CSS
  • Javascript
  • Images
  • Json
  • XML
  • PDF files

When you dynamically generate data, you should also understand the tools available (for example, the Perl community has a strong preference for TT for HTML generation, but there are other options like Mason , and JSON :: Any tends to be my goto for JSON).

Transport mechanisms

  • HTTP (including status codes to use and when, how to redirect, what methods (POST, GET, PUT, etc.) to use and when).
  • HTTPS (HTTP with SSL encryption)

How to make the web server talk to your Perl

  • PSGI / Plack if you want modern and efficient
  • CGI for very simple
  • mod_perl , if you need crazy power levels (I saw someone turn Apache HTTPD into an SMTP spam filter using it).

Security

How to protect against malicious input (which basically comes down to understanding how to receive data in one format (for example, submitted form data) and convert it to another (for example, HTML or SQL).

Web frames

You can redirect a lot of work to a framework that provides structured ways to organize web applications.

  • Web :: Simple is simple
  • Dancer seems to be holding the middle (although I have to admit that I have not yet had the opportunity to use it)
  • Catalyst probably has the steepest learning curve, but comes with lots of power and plugins.
+15
source

Depending on the complexity of your project, you may look at Catalyst MVC . This is a good structure that uses most of the queries, but gives you a fairly deep idea of ​​what is going on.

In CPAN

If you want to start with mod_perl or CGI, there are also a few lessons:

+2
source

If you want to try web programming in Perl, you can try hosting the Dancer application on OpenShift Express .

There's even a Dancer on OpenShift Express repository to get you started: https://github.com/openshift/dancer-example

+1
source

Source: https://habr.com/ru/post/895545/


All Articles