Modern Perl Web Development

Last Saturday was the annual London Perl Workshop. I’ll have more to say about the day later[1], but I just wanted to take the time to share the slides for the workshop that I ran in the morning. It was a quick guide to modern Perl web development. And, as far as I’m concerned, that basically means PSGI and Plack.

Update: People asked me to put the example PSGI apps from the workshop online somewhere. They’re now all on github. Let me know if you find them at all useful.

[1] Executive summary: a wonderful day, thanks to everyone who was involved – particularly Mark Keating.

7 thoughts on “Modern Perl Web Development

  1. I find this the “most modern” among the large number of resources/talks/tutorials on the web that attempt to introduce Plack and here’s why: Almost every Plack tutorial largely concentrates on how you can get your existing web applications running under PSGI. This is the first one that emphasizes writing new applications through its description of Plack::Request and Plack::Response. Thanks – Great introduction

    1. I focus on how to connect existing apps and frameworks to run on Plack, because that’s what people should do and forget about everything else.

      Plack is NOT a framework but a glue to connect (existing or new) frameworks to (existing or new) web servers. I am AGAINST writing new apps with Plack::Request. This is like writing a web application using libapreq back when mod_perl was shiny – it’s yet too raw level and almost DEFEATS the purpose of PSGI in the first place.

      What I recommend to make it feel “most modern” as you say, would be to write a new framework, like Sinatra in Ruby, by only using Plack/PSGI as an interface. A couple of new frameworks have been born since the introduction of Plack, like Web::Simple, (my own) Tatsumaki and Dancer. People should focus more on writing apps on top of those, instead of writing raw PSGI apps.

      Please. Plack is not a framework, but to embrace more diversity on how to write apps and web servers by connecting them with a simple glue code and tools (such as plackup, Plack::Test and bunch of middleware components).

      1. Thank you for the explanation. I understand why Plack is not a framework. I was not aware of Web::Simple I will look at Web::Simple right away. I am going through the Dancer Advent Calendar and hoping to see if it can help with a few apps I have in mind.

        Thank you once again for pointing me to frameworks that use Plack directly rather than via CGI.

    2. You seem to say that migrating existing apps to PSGI is boring and has not much value as compared to writing new apps. That’s so wrong.

      Making your existing apps to run on PSGI by adapting the framework to PSGI has the benefits of: a) Your code needs no changes b) You can use all of Plack::Middleware::* on CPAN and c) can use all of sophisticated new Perl PSGI web servers such as Starman, Starlet and Feersum.

      It might be fair to say that migrating existing code is boring for *you*, but abusing it just for fun and saying that’s more interesting, makes me so sad.

      1. My sincerest apologies. I had no intention of saying or meaning that porting existing applications is boring or that tutorials and presentations should not address how that can be done with Plack.

        If my comment suggests that, then I have obviously miscommunicated and would like to correct that impression right away.

        I have migrated 3 fairly large applications from CGI::Application to CGI::Application::PSGI without *any* change. The fact that I could do it without even understanding how Plack works is a testimony to its brilliance. What I meant in my comment was that this presentation somehow made a connection with how Plack works so that beginners like me could get a glimpse.

        If I have caused you to be sad, I apologise most sincerely. That was certainly not my intention

Leave a Reply