Deploying Perl Web Applications

Cory Watson will give a talk at YAPC::NA 2012 described as: 

Perl web applications have been running for a really long time.  What started as CGI scripts has evolved into frameworks and middleware with JavaScript frontends. Perl itself has evolved with Perl 5 barreling along.  Our modern applications also use lots of modules from CPAN.  How can we use all this new, awesome stuff without making for a deployment nightmare? In recent client work we’ve tackled this problem and we’ve come up with a pretty good solution.  

In this talk we’ll take the journey from concept to deployment. We’ll discuss the advantages, limitations and lingering problems.  We’ll cover local::lib, cpanm, Dist::Zilla, carton, pinto and how much I hate all of them. We’ll culminate with a self-contained, repeatable, upgradeable Perl application and only a few unsolved gotchas.

[From the YAPC::NA Blog.]

Returning to Zurich

I have been most fortunate to have been able to visit Zurich every year since 2008, to teach classes at the ETH.

Zurich is one of my favorite cities in the world: there’s something undefinably “civilized” about it. It’s elegant, but vibrant, and yet strangely tranquil too. From the glorious lake-front to the sylvan Zurichberg, its natural beauties always draw me back. Not to mention the wonderful food.

And yet, the reason I keep returning to Zurich is not any of those undeniable attractions. It’s the people I meet and work with there. Smart, serious, witty, genuine, and generous people. Developers, academics, and scientists, who are always a pleasure to teach…and a joy to learn from as well.

This year we’re going to try something a little different in Zurich. My previous visits have always been later in the year, but in 2012 we’re experimenting with a Spring schedule with four completely new classes.

Hacktivity report (Jan-Mar 2012)

Perinci

For the past 2.5 months I mostly worked on converting my old Sub::Spec::* modules to the new Perinci::*. Sub::Spec is a mix of specification, convention, and tools to let you decorate functions with documentation as well as everything else, but most commonly argument specification and feature description. This decoration can in turn be used to do various things, from generating POD, to validating arguments, to shell completion.

The reason I picked a new name for the modules is because I want to decorate other code entities too, like variables and packages, thus the prefix "Sub::" is no longer apt. I also took advantage of this opportunity by introducing some backwards-incompatible changes like the change to schema of arguments specification. The specification is now separated more formally into Rinci (a la PSGI vs Plack) where the Perl implementation is called Perinci, short for "Perl Rinci". I envision Pyrinci, Rubinci, and Phinci seeing the light of day someday, though that would most likely be due to the effort of others.

Parisienne Walkways - 2012 QA Hackathon (Part 2)

And so to the final part of my notes from the 2012 QA Hackathon.

CPAN Testers Report Status

After asking several times, Andreas thought he finally understood what the dates mean on the Status page for the CPAN Testers Reports. He started watching and making page requests to see whether his requests were actioned. On Day 3 he pointed out that the date went backwards! Once he'd shown me, I understand now why the first date is confusing. And for anyone else who has been confused by it, you can blame Amazon. SimpleDB sucks. It's why the Metabase is moving to another NoSQL DB.

BlueHost has become a sponsor of YAPC::NA 2012! And...



BlueHost has become a sponsor of YAPC::NA 2012! And they’re hiring!

Bluehost is one of the leading web hosting firms in the United States. The company has a rock solid shared hosting platform to support individuals, professionals and small businesses. In addition, Bluehost has the best customer support rating (NPS) in the industry. All development at Bluehost is done with Perl. The development team has a number of senior Perl developers who are regular contributors to CPAN, having written modules such as CGI::EX and Template::Alloy. One of the Bluehost developers helped write Strawberry Perl. If you are interested in joining a leading edge Perl development shop, come talk to us at the YAPC job fair. 

[From the YAPC::NA Blog.]

Dancer article on SDJ

Some time ago I was invited to write a Perl article to Software Developers Journal. It is (as far as I could gather) a magazine based on Poland. Their website is at http://en.sdjournal.org/. It is a paid magazine, so to read it you should buy the magazine.

Although the magazine doesn’t have good procedures for publication (there isn’t a review phase where the authors can check if everything is fine) we think (yes, I co-authored the article with Nuno “smash” Carvalho) that the article is interesting. Probably with some English errors written by us, and probably with some others introduces by the editors. And yes, it is not our fault that they write Pearl instead of Perl… oh shame…

We are working the permission to post the article in the web. Probably we can in some time. For now, buy the magazine.

Love letter from Grace

This email slipped through Gmail's spam filter just now:

Subject: Hello

My name is Grace, i saw your profile at (www.cpan.org) today and became interested in you, i will also like to know you more, and i want you to send an email to my email address so i can give you my pictures for you to know whom i am. Here is my email address (gracejobe16@yahoo.de) I believe we can move from here. I am waiting for your reply in my mail. Remember the distance or color does not matter but love matters allot in life.

Yours Grace.

I don't know whether I should be sad or glad. Glad for the fact that cpan.org is considered popular enough to be worthy to be phished, or sad that no sites go unphished these days?

Compiling mod_perl 2 on OS X Lion

Since updating to the latest XCode on OS X Lion, we've been unable to build or use mod_perl 2 on our development machines. If we ignore the test failures and make install anyhow, we get this error message when trying to start Apache:

Cannot load /opt/local/apache2/modules/mod_perl.so into server: dlopen(/opt/local/apache2/modules/mod_perl.so, 10): Symbol not found: _modperl_handler_anon_add

One of our developers discovered this morning that llvm/clang on OS X defaults to C99, but mod_perl expects the 89 "standard". As a result of this thread, we compiled mod_perl in the following manner:

perl Makefile.PL MP_APXS=/path/to/apache/bin/apxs MP_CCOPTS=-std=gnu89
make
make test
make install

And voila, we have a working mod_perl 2 on Lion.

Come to find out, while researching this blog post, the macports people have already run into this:

Hope this saves you the grief it caused us.

We’ve moved the YAPC::NA 2012 Job Fair and Expo into a...



We’ve moved the YAPC::NA 2012 Job Fair and Expo into a larger room to accommodate  demand. As a result we now have a few more tables available for those looking to exhibit. Contact admin [at] yapcna [dot] org if you’re interested.

Also, we this means we have more space for Startup Row. If you have a new startup and are looking to promote it, we’ll give you a free table at YAPC!

[From the YAPC::NA Blog.]

booking.com sponsors YAPC::Europe 2012

We welcome booking.com as a Platinum Sponsor of this years' YAPC::Europe. It's amazing to get so much support from companies using Perl. Thanks!

blog_booking.jpg

Due to the growth of Booking.com's IT department we are now hiring 30 Perl Developers!

Booking.com is part of Priceline.com and is the World’s #1 Online Hotel Reservations Company, offering over 200,000 hotels worldwide.

We use Perl, Apache, mod_perl, MySQL, Memcache, Mason, JavaScript, Git, Linux & more!

Our software development basis is SCRUM = Agile.

Are you ready to relocate to Amsterdam to an international, result driven, fun & dynamic work environment? Join us! Go to htttp://www.booking.com/jobs to apply.

Have you seen perl-reversion?

I just wanted to share a “new to me” script in case its new to any of you too. After a quick twitter exchange between me and @rjbs he told me about the script perl-reversion which is a part of the module Perl::Version.

Just run

perl-reversion -bump

in your distribution folder and it will find and bump the version numbers in all the files! What a time saver when developing! Thanks RJBS for sharing this with me and thanks Andy Armstrong for releasing it!

Edit: A previous version of this post decried the fact that the script was not installed but rather was in the examples folder. After reading further I see that it IS in fact installed by using some Makefile.PL trickery. Why not just put the script in a directory named bin rather than examples and it will be installed without trickery?

Generalized single element access

chromatic explained his problem with auto-dereferencing in the hash and array operators, and I said a bit more about it. I missed the right day to post this, but I had a half baked idea about solving the problem.

Basically, the auto-dereferencing, in combination with Perl 5.12 allowing hash operators to extend to arrays, means that part of the problem doesn't care what you have and another part does. When you want to do a single element access, you still have syntax that must denote the reference type. If you have a hash, you need curlies:

foreach my $key ( keys $hash_or_array ) {
     my $value = $hash_or_array->{ $key };
     }

But, if that's an array reference, you need square braces:

Lots of Perl Authors

From guest contributor brian d foy:

Based on the YAPC::NA schedule, I noticed that we have quite a few Perl authors will be at the conference, representing at least 15 different Perl titles. There may be more authors and more titles (please let us know so we can update this list), but this is quite impressive for a 400 person conference. Bring your favorite books to get them signed by your favorite authors. Track them down on Facebook or Google Images so you can know what they look like. I’ve already tracked down some images for you:

  • brian d foy
    • Learning Perl, 6th Edition
    • Intermediate Perl, 2nd Edition
    • Mastering Perl
    • Programming Perl, 4th Edition
    • Effective Perl Programming, 2nd Edition
    • The Learning Perl Student Workbook
  • Randal Schwartz (merlyn)
    • Programming Perl, 1st and 2nd Edition
    • Learning Perl
    • Intermediate Perl
    • Perls of Wisdom
  • Tom Christiansen (tchrist)
    • The Perl Cookbook
    • Programming Perl
  • Andrew Johnson
    • Elements of Programming with Perl
  • Matt Trout (mst)
    • The Definitive Guide to Catalyst
  • Andy Lester (petdance)
    • Land the Tech Job You Love
    • Pro Perl Debugging
    • Mac OS X Tiger in a Nutshell
  • Dave Rolsky (autarch)
    • Embedding Perl in HTML with Mason
    • RT Essentials
  • Scott Walters (scrottie)
    • Perl 6 Now

[From the YAPC::NA Blog.]

A real Grant Report for the Perl 6 Tablets

Allright, long long time ago i got this TPF grant. You were all a generous boss to not tackle me because i had other important stuff to do for Perl community (including Perl 6 articles for $foo perl magazine, perlzeitung and heise online - the leading German IT news portal and a modern perl 5 tut to spread the praise of Perl into the free software world). But because slowly are coming in real results, I write now a real grant report the TPF can publish.

Create PDF from many POD files

Using POD as the basis of documentation for Perl projects is the usual way to do. There are many modules available to convert POD into several formats. However, I was not able to find a module that creates a single PDF file from all the documentation available for e.g. a single project. Typically a series of PDF files are the result of a conversion. Combining these files and creating a hierarchical outline can be hard work.

As a simple aid, we peeked into pod2pdf and wrote a little wrapper around it in order to handle many files and create the outline. Well, this solution is not rock solid, as we rely on its internals but at least it is short and usually creating PDFs is not mission-critical.

Maybe some parts can still be improved, but for people interested, here is my first try: https://gist.github.com/2277444. Feedback welcome!

Sponsoring CPAN Testers

CPAN Testers has now been running for nearly 13 years. In that time we have been supported mostly by the community and some very thoughtful individuals, to whom we owe a massive thank you. Ten years ago we were submitting less than 1,000 reports (March 2002) each month, 5 years ago we reached a new high with just under 25,000 reports (March 2007) submitted. In the last year it is no longer unusual to see 1 million reports (August 2011) submissions in a single month. Regular readers of this blog will be well aware of how successful CPAN Testers has become, and how much data we store, as we sped past 20 million reports in February 2012.

Statistics and data mining with Perl Data Language

Maggie Xiong will give a talk at YAPC::NA 2012 described as: 

I will start with a refresher (or intro if this is your first encounter with statistics) on the core statistical reasoning, namely the null hypothesis and the partitioning of variance, and go through a few standard statistical tests in PDL::Stats. We will also touch on how this core reasoning extends to typical data mining techniques such as linear regression and k-means cluster analysis.

[From the YAPC::NA Blog.]

The ways to Frankfurt...

Frankfurt am Main is relatively close to the center of Germany.


Größere Karte anzeigen

The ways to reach it are

  • By airplane

Vim report for Devel::Cover (Perl QA Hackathon)

Last night over dinner I had a discussion with Miyagawa about what Devel::Cover could steal from Ruby. He mentioned a Ruby backend which uses Vim signs to show coverage information.

So today I shamelessly stole it and produced a basic version for Devel::Cover.

Devel::Cover has more coverage criteria, so extra work will be required to provide this information, but the report seems useful for now. To use it run

$ cover -report vim

and then in vim:

:so cover_db/coverage.vim

I'd be happy to get bug reports, feature requests, patches or even pull requests against the repository. And if anyone would like to take this idea and produce a backend for emacs or any other editor, please do so.

This has just been released in Devel::Cover 0.84. This is the second Devel::Cover release I have made at the QA hackathon in Paris this weekend. Many, many thanks to all the organisers, sponsors and participants.

Major DB::Color update (Perl QA Hackathon)

After my previous announcement of DB::Color, I've not had much time to work on it. I eventually disabled it on my box because it was broken on many common cases. Thanks to the Paris Perl QA Hackathon, I've solved a few nasty bugs and now I'm happily using it to debug Perl.

There are some caveats.

Syntax highlighting is slow and is broken in a few edge cases. To get around the first issue, I have naïve caching of syntax highlighted files (change the files and the MD5 sum differs and you get a new cache). Any cached file not used in the last 30 days is deleted.

The broken syntax highlighting has resulted in several bug reports for Syntax::Highlight::Engine::Kate.

My favorite bit (cough) with how I replace lines of code with the syntax highlighted versions is this:

Read that last comment. That's the sort of subtle issues that keep tripping me up while I write this. The latest release is on Github and will shortly hit CPAN.

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.