Question

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?

Was it helpful?

Solution

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.

OTHER TIPS

I have been learning/using Mojolicious, it has some nice tutorials/examples. Also, I actually like that it has mini-servers as you call them. It has (what it claims is, can't say I have used it in a high-load env.) a production quality server (Hypnotoad) and integration with Plack for later; who wants to mess with Apache configuration! I like that the templating engine is simple and a single file is all that you need to start a full app.

The other answers here are right on target, however, you may wish to learn following a video instead. I've seen 2 "Dancer" videos on youtube. Google "perl dancer site:youtube.com" to find "Building a blog engine using" and "Introduction to Dancer" videos.

As for using the "mini servers". I found the perldoc for Dancer Deployment provided many options. I decided to use plackup and Starman. The performance has been pretty great. Added nginx to serve the static content.

Have you found the Dancer Advent Calendar http://advent.perldancer.org ? You can mirror that entire site via Git. Lots of tutorials there - and since you have the entire site, you can see how it worked under the covers.

A bit late since this node's entire time-scope (before this post) was Advent 2011 and it's just gone Easter ;P

For a free set of tutorials about web technologies like HTML, jQuery, etc., you could do a lot worse than visiting this URI where you can learn-by-practise using their sweet tryit widget:

http://www.w3schools.com/sitemap/default.asp#tutorials

Warning: Loads of advertising content but that's sometimes the cost of freedom in communications media. I've not detected any malware, though I'm on Linux not Wind'oh$ or App£€.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top