How can I start out with web development using Perl?

BackPacker777 picture BackPacker777 · Dec 6, 2011 · Viewed 10.3k times · Source

I want to be able to create web front-ends to my Perl programs. I have a lot of experience with Perl, and I have converted most of my code to Modern Perl paradigms championed by Chromatic. I have ZERO experience writing web pages though. (The occasional Word save-as-web-page notwithstanding).

I believe that I know which tools to start with, I am simply having difficulty with their beginning documentation and in which order to learn the tools.

  • Perl: I am all set here.

  • Dancer: I have created a site but I am very lost and the cpan docs simply confuse me further. I have no idea how to integrate these sites with Apache instead of using the mini server that comes with Dancer.

  • Template Toolkit: This one seems the most straight forward and I have the O'Reilly book. Seems like an awfully big book for something that seems easy, so I know I am missing something.

  • HTML: How much should I learn? What is the best learning path?

Ultimately, what would be nice is a complete 'Building Modern Websites with Perl from the Ground Up' tutorial, book, video series, or web site.

Please, where do I start?

Answer

Sinan Ünür picture Sinan Ünür · Dec 6, 2011

You need to first decide what you are trying to do. Are you trying to write a dynamic site, generating web pages whose content vary depending on requests or are you trying to make building a static web site easier?

Either way, you should learn HTML on its own, and write some static web pages by hand. Then, realize that you can use Template::Toolkit's ttree to factor out common parts (header, footer, sidebar etc) and build a static site with uniform appearance.

The second step would be to use Perl to generate some dynamic pages. Learn CGI first to understand the basics, see also RFC 3875.

Also, look into HTTP and understand how web servers work.

Dancer is my favorite web application framework of the moment. By the time you have worked on the earlier steps, it will be somewhat obvious what Dancer does for you.

You need to first be able to separate actually separate concepts in your mind.