Perl Today (February 2014)

brian d foy is the author of Mastering Perl, now available in its second edition, as well as several other Perl books. As the founder of Perl mongers, he's been active in the Perl community for almost 20 years.

Perl's so big now that it's almost impossible to pay attention to everything going on. Instead of reading the thoughts of me, just one person, on the current state of Perl, why not gather several major players who can cover many areas that you may not have noticed? I've collected some voices from parts of the large and diverse Perl community to highlight a small fraction of everything going on, from community development, hard core coding, the job market, and various problem domains. Although not definitive, their combination makes a good summary.

Randal Schwartz is the original author of Programming perl and Learning Perl, along with numerous other Perl credits. He's the current host of FLOSS Weekly.

Perl started as a Unix shell replacement to help sysadmins get more productive with less risk and a flatter learning curve (you didn't have to learn the quirks of dozens of small utilities, just the quirks of One Larry Wall).

But then along came the web, and "scripts" could be used to provide interactive web pages, and Perl became the darling language of the web, first with "", and then with, and later with larger frameworks like Mason and Catalyst.

Of course, Perl's scripting abilities also matured, and the ability to scale Perl programs with modern testing and OO frameworks (like Moose) empowered programmers to write 10-line scripts and 100,000-line applications using the same core language features: a distinctive advantage.

Perl 5 development stagnated a bit, trigging the whole "Perl 6" revival, and the relationship between Perl 5 and Perl 6 is still not understood by most people outside the direct Perl community (nor even by some who are *in* the community). But with the establishment of the quarterly point release, and the annual major releases, Perl 5 seems to have gotten firmly back in the saddle of modern development again. And while Perl 6 continues to be developed and redesigned, parts of it are already quite useful for early adopters.

Karen Pauley was a founding member of the Belfast Perl Mongers, a volunteer with the YAPC Europe Foundation, and is the President of The Perl Foundation.

For me, Perl is a reason for creating community systems to support Perl itself. The Perl Foundation doesn't write the Perl language, we don't influence its direction; instead we work with the Perl community to organize funding, volunteers, marketing, and legal counsel.

The Perl 5 Core Maintenance fund was created in June 2011, in collaboration with some of Perl 5's most generous supporters, such as and craigslist Charitable Fund. Our goal was to pay a few key volunteer developers to spend more of their time working on the maintenance and development of Perl 5. So far we have raised over $280,000 allowing us to compensate Perl internals experts including Nicholas Clark and Dave Mitchell to do more than they could on an unpaid basis.

The Perl Foundation, with help from our volunteers and donors, will continue to seek ways to strengthen the language, its community, and the F/OSS world in the coming years.

Steffen is a physicist-turned-software developer. A long time contributor to Perl and author of many Perl modules on the CPAN, he currently works at where he manages software infrastructure development..

With, Perl powers one of the most successful, profitable e-commerce companies on the planet. Perl is used throughout our stack from the web layer to mission-critical, highly-available infrastructure. We love it because its flexibility aligns with our aggressive pace of development on our code base of millions of lines of code. We believe that the language's versatility has given us a competitive advantage.

Outside of, I am an individual contributor to Perl and the CPAN. Thus I have had the chance to directly support users in more than just a handful of Fortune 500 companies including major banks as well as the IT, automotive, and chemical industries. Perl is used in critical systems of many companies albeit usually in much less prominent roles. It is a humble work horse and truly deserves its reputation as a Swiss Army Chainsaw.

At, we believe that one of Perl's great strengths is its community. Unlike many corporations, we maintain strong symbiotic ties to this development community. Many of our technical staff are active contributors to Perl and Perl modules on the CPAN. We encourage our developers to publish their code. This has both helped with getting our name out to potential future employees and improved the quality of our software overall.

Ricardo Signes is the current Perl 5 project manager, part of the CPAN toolchain maintenance team, and a prolific contributor to the CPAN.

Perl 5 is entering its fifth year of fixed-schedule releases, meaning that the first few releases on the yearly plans are now out of their supported lifetime. With the release support policy solidly in place, we've begun to hammer out exactly how we handle Perl's iffiest behaviors: deprecated and experimental features. Enumerating just which features are experimental let us get an idea of what we mean when we say something is experimental, which has led to a means to add new features to Perl without as much fear of getting locked in to bad ideas.

We've gotten a number of exciting new features in the latest perl builds, as experiments. Lexical subroutines, regexp character sets, and postfix dereferencing are the three I'm most excited about, and the prospect of experimental subroutine signatures still looks good.

Over the next few releases, I'm hoping we'll see improvement continue in three main areas: Perl 5's already-excellent Unicode support, the useful but troublesome PerlIO system, and the ability to provide annotations for improving performance.

Joel Berger has a Ph.D. in Physics from the University of Illinois at Chicago. He is currently employed writing software for a major financial institution.

Perl is my language of choice for almost any task. In my research I routinely found that the flexibility of Perl allowed me to structure a script or simulation in the way that I was thinking about the problem, not the way the language wanted me to think about it. Modern tools like the Moose object framework give Perl the ability to model the most complex set of interdependent classes (as often arises in Physics) with ease. Combine that with the massive CPAN module archive, from which you can find tools to transform nearly any data format, manipulate and analyze data, or do nearly any other task.

In my spare time, I contribute to the Mojolicious web framework, which brings the trendy non-blocking web to Perl, a robust and stable language (and the only language with CPAN). Mojolicious comes with lots of functionality like a non-blocking UserAgent (which is also the backbone of the extensive test framework), DOM parser, WebSockets, JSON, and a powerful template system, all built in.

Sawyer X is one of the core developers on Dancer, a Perl web framework inspired by Ruby's Sinatra.

Perl is often remembered as the original language of the web. It had good CGI support and was the go-to language for any web programming. The CGI protocol had its issues and so was replaced in time by FastCGI, embedded interpreters in the web servers (mod_perl, mod_php, etc.), and servers implemented in the application language.

While you weren't watching, Perl has developed a common protocol, binding web servers, web frameworks, and web applications: PSGI. PSGI allows any web server to support any web framework and web application. It allows any web framework to support any server, and any user to use any framework on top of any server. In two words: anything goes.

On one hand new frameworks appeared (Dancer, Mojolicious, Amon2) and mature frameworks (Catalyst) started supporting PSGI, and on the other hand web servers written entirely in Perl grew into existence, such as Starman, Twiggy, Corona, and more.

Stevan Little created Moose, a post-modern object system for Perl 5. He's working on adding this to the Perl core language.

Perl has had object oriented capabilities since the first release of Perl 5 almost 20 years ago. Since then, best practices have come and gone, along with a sea of modules on the CPAN to help programmers implement those best practices. Although many OO styles still abound, the current Modern Perl movement has come to settle around the style of OO implemented by the Moose module.

Moose itself is based heavily on the OO features that have been designed for Perl 6, along with input from several other languages including LISP, Ruby, Smalltalk and others. Moose brings not only support for basic class based OO programming, but it also brings deep meta programming capabilities, and the idea of "Roles" to Perl OO programming. Roles - which were originally derived from the Smalltalk community where they were called "Traits" - provide a means of code re-use similar to mix-ins but with an added degree of compositional safety through the use of conflict detection. Moose was originally released in 2006 and in the past 7 years more 2,100 CPAN modules have been released which depend upon it.

David Mertens is a Visiting Assistant Professor at Dickinson College and a contributor to PDL and Prima.

I have been using Perl for my scientific computing since roughly 2007. Prior to Perl I wrote the bulk of my scientific code in C++ and Matlab. My first exposure to Perl was due to its well known string processing capabilities, but I quickly realized that it was a well designed general purpose programming language. After programming in Perl, Matlab felt cludgy and C++ felt verbose. Once I discovered the PDL (Perl Data Language), I switched all of new scientific computing to Perl.

My most exciting work with Perl has been at the interface of PDL and other modules. A few years ago I discovered the Prima graphical toolkit and eventually wrote PDL-based methods for fast and flexible drawing to a Prima canvas. As my familiarity with Prima has grown, I have begun using it to write interactive simulations for talks and lectures.

Time and again I found other Perl developers had solved 90% of my problem, leaving the last and most exciting 10% to me. From numerical simulations to web servers to interactive lectures, I can always find the right Perl tool for the job, and the right Perl glue to put it all together.

Dave Cross is the owner of Magnum Solutions Ltd., a Perl training and consultancy company based in London. He founded, the first Perl Monger group outside of North America. Dave blogs about Perl at Perl Hacks.

I've been running Perl training courses for six or seven years. The demand for these courses has never been higher than I've seen over the last year, coming from all kinds of companies--financial services companies, media giants, dotcoms and many others.

The nature of those enquiries has been changing. Previously I would get enquiries about generic beginners, intermediate or advanced Perl courses, these days it is just as likely to be a request for training about a specific Perl module like Moose or DBIx::Class. These enquiries are coming from companies who have been using Perl for many years but who finally seem to be getting the message that Perl has changed over the last ten years and that by keeping the knowledge of their Perl teams up to date they will retain the competitive advantage that was the reason for them choosing Perl in the first place.

Part of this, I'm sure, is driven by the recruitment market in London. There are a lot of companies trying to employ a relatively small number of Perl programmers. This means that the best programmers can be picky and only work for companies that are only using the most modern tools.

Andrew Shitov is a Perl enthusiast working with the language since 1998, the organiser of 30+ local and international Perl events in 8 countries, including two YAPC::Europe conferences. leader in 2007-2013.

Perl is not the only programming language in the Universe any more, and thus it might feel that developers do not consider it as the only option. This, on the one hand, is a very pleasant time for improving the language, but on the other hand, Perl suffers from the fact that the language core developers might not feel the responsibility for keeping their product perfect, compatible and suitable for the need of modern programming. Perl faces the danger coming from inside of itself: we have seen a number of annoying incompatibilities introduced in recent releases, not counting the delay of Perl 6 which made Perl less competitive. All in all, Perl is now in a very comfortable position to be able to flush all the bad stuff and be re-born.

[from brian: since Andrew is active in the Russian Perl community, I wanted to publish his response in Russian too.]

Сегодня перл находится в таком состоянии, когда он уже не единственный язык во Вселенной, поэтому ему может казаться, что разработчики больше не выбирают его. Это, с одной стороны, очень приятное время для развития языка, но, с другой стороны, перл страдает от того факта, что разработчики языка не ощущают ответственности за поддержание своего продукта качественным, совместимым и отвечающим нуждам современного программирования. Перл столкнулся с опасностью, исходящей из самого себя: мы видели много раздражающих несовместимостей, введенных в последних релизах, не считая задержку с Perl 6, которая сделала перл менее конкурентноспособным. Так или иначе, сейчас перл находится в очень удобном положении и способен сбросить все плохое и переродиться. Мы должны воспользоваться этим шансом.

Neil has managed research and development teams for startups and multinationals. He's currently working on a startup that uses Perl, and also likes to work on projects related to CPAN curation. He started programming in Perl in 1993.

The Perl Authors Upload Server (PAUSE), our gateway to CPAN, has been seeing more and more action. 844 people created a new account in 2013 (second only to 2012, with 858). Of those 844 new users, 389 have released something on CPAN to date. Overall, 1803 of the 11k PAUSE users released something in 2013 (2012's total was 1759). Those 1803 users released 7440 different distributions in 2013, the best year ever. Read more about CPAN in 2013 on the CPAN Report.

Recent upgrades to the awesome CPAN Testers mean we see results within an hour of uploading a module. Within days of releasing a distribution we get feedback on how well our code tests out on a wide range of configurations. Roughly one million reports are uploaded each month.

PrePAN is a new website where we can describe module ideas and get feedback before we commit a specific design to CPAN.

Questhub has a growing community of Perl developers who use it to manage their backlog of Perl projects ('quests'). Template quests encourage you to contribute to Perl, get involved with the community, improve your distributions, and help others with theirs.

The adoption list identifies stale distributions that are of value to CPAN (e.g. being used by other distributions), but might have lost their primary developer. If you're looking for a project, consider taking on something from the list.

The Year in Perl 2013 Retrospective

The Year in Perl 2013

Welcome to 2014, Perl mongers, fans, hackers, and dabblers. It's been a big year in our quirky little language. The community has grown. The CPAN has expanded. Bugs have been squashed, conferences attended, and projects released. Here's a cross-section of what happened that you may have missed.

January 2013

The 2013 Perl Oasis conference took place in Orlando, Florida, US.

At the Perl Oasis conference, Stevan Little gave a talk entitled Perl is not Dead, it is a Dead End about forking Perl to experiment with new design and implementation ideas. The talk included an announcement of Moe, a reimplementation of parts of Perl. By September, Moe would go dormant.

Shawn Moore formally deprecated Any::Moose. If you need a lightweight OO system which can upgrade to Moose when you use Moose features, use Moo instead.

Nick Perez wrote an article about CloudPAN, a way to use modules locally without installing them.

Dan Write of TP/a published a report on the Perl 5 Core Maintenance Fund.

Matsuno Tokuhiro announced plenv, a Pler installation management tool. Compare it to perlbrew and Ruby's rbenv.

The Perl 5 Porters announced core modules scheduled for removal in Perl 5.20.

VM Brasseur tackled the problem of recruiting new programmers to Perl in Improving Perl's New Programmer Outreach.

Ovid announced the release of Test::Class::Moose to the CPAN. Since then, he's expanded the combination of Test::Class with Moosey goodness to create the ultimate testing tool. See the Test::Class::Moose introduction video.

David Golden announced Path::Tiny, the successor to Path::Class. If you're still using File::Spec, try Path::Tiny.

February 2013

Vyacheslav Matjukhin announced Play Perl. This is a public system for announcing and accepting quests to accomplish Perl-related tasks. Play Perl has become Questhub, but it is still powered by Perl. Ruslan Zakirov quickly added quests for Perl core development.

Sawyer X and the Dancer team released Dancer2, the new version of the powerful Dancer micro web framework. Dancer 1 is still maintained.

Kartik Thakore and the Perl SDL team announced bindings to SDL2, the update to the cross-platform graphic, sound, and input libraries.

Perl pumpking RJBS converted Email::Sender to Moo and saw tremendous test suite time savings. (See also the deprecation of Any::Moose.)

Peter Rabbitson announced a faster DBIx::Class, with many impressive speed improvements. The 0.08250 release in late April would prove to be the fastest stable release yet. (See John Napiorkowski's post on the 20% speed improvements in the new DBIC release.)

PAUSE administrator and Perl guru brian d foy reminded CPAN authors to set their modules free when the time has come to hand over maintenance.

Rob Hammond explained how to use Perl and PhantomJS to scrape the JavaScript web.

Paul Fenwick wowed the crowd, as always, with his talk The Perl Renaissance.

The Israeli Perl Workshop took place in Tel Aviv, Israel.

March 2013

A flaw in Perl's rehashing mechanism (resizing hash tables when adding new keys) was corrected in the five most recent stable releases of Perl. Perl 5.18 would make hash key order slightly more random, exposing long-standing bugs in several programs. 5.18 also introduced lexical subroutines, which will be very useful.

A project called PrePA (footnote: /a) emerged. PrePAN is a place where you can discuss modules before you decide to upload them to the CPAN. In March 2013, PrePAN joined the CPAN-API organization. (You may know CPAN-API better as MetaCPA (footnote: /a).

Michael Schwern announced a quick start guide for perl5i. perl5i is an experimental distribution of Perl which includes a lot of syntax-warping modules that may or may not influence core development in the future.

brian d foy experimented with a small community-funded CPAN project.

Neil Bowers began experimenting with The Perl Hub, a sort of dashboard to the Perl community. It includes links to blog posts, CPAN reviews, talks, events, and quests.

Giel Goudsmit wrote a decade retrospective of, the Perl powerhouse in the Netherlands.

Perhaps drawing from Play Perl (or perhaps from his relentless research into psychology, motivation, and fun), Paul Fenwick announced a CLI tool for HabitRPG, a todo app in a fantasy setting.

Pragmatic Perl, a Russian web newsletter, published its first issue. The newsletter interviews Perl developers and the English translations of its interviews are often full of insights.

The Perl Tricks web site launched to promote Perl with short articles.

The German Perl Workshop took place in Berlin, Germany.

The Swiss Perl Workshop took place in Bern, Switzerland.

April 2013's Subversion hosting service ended. shutdown announced on Github, Bitbucket, and other free DVCS hosting are great alternatives.

Best Practical updated, the bug tracker for CPAN and the Perl core, to RT 4. The 4 upgrade announcement has more details about what this means for CPAN authors and Perl hackers. In September, Best Practical would announce the release of RT 4.2.0.

Tim Bunce announced the release of Devel::NYTProf 5, which includes a flame graph in the profile. This is a great visualization of where your program spends its time.

Andy Lester and the ack developers announced the release of ack 2.0. ack's selling point is "better than grep", and it certainly is.

The 2013 Perl QA hackathon took place. David Golden summarized the Lancaster Consensus, the latest guideline for toolchain support when managing CPAN distributions.

Fred Moyer announced the release of mod_perl 2.08.

The Open Source Developers Conference Taiwan took place in Taipei, Taiwan.

Daisuke Maki published results of the 2013 Perl 5 Census Japan. Perl in Japan looks very different from Perl in the US or EU.

Gabor Szabo linked to Pinto tutorials in multiple languages.

The Dutch Perl Workshop took place in Arnhem, The Netherlands.

The DC Baltimore Perl Workshop took place in Baltimore, Maryland, USA.

May 2013

In sad news, CPAN developer AMORETTE—Hojung Yoon—passed away on May 8, 2013. South Korea and Perl lost a valued member of the community. C.H. Kang posted a small tribute to Hojung Yoon on Twitter.

The Perl 5 Porters announced the release of Perl 5.18. This yearly release added a couple of nice new features, fixed a slew of bugs, updated some core modules, and updated plans to continue Perl's evolution to 5.20 and beyond. See the Perl 5.18 delta documentation for more details. CPAN developers had some work to do; see David Oswald's A call to action for CPAN authors about finding and fixing hash order bugs in library code as well as Mark Fowler's explanation of hash key ordering changes.

The Mojolicious team started beating the drum about the upcoming Mojolicious 4.0 release. Joel Berger introduced some new features of Mojolicious 4.0. Mojolicious creator Sebastian Riedel provided the Mojolicious 4.0 release announcement.

The Bugzilla developers announced the releases of Bugzilla 4.4 and 4.2.6. The code in this long-lived project keeps getting better and better as development continues.

Joel Berger also finished a TPF grant. His report at the completion of the Alien::Base grant gives a retrospective of the project.

Toby Inkster continued making things smaller, faster, and easier to use in isolation. While his Moops module is your editor's favorite, his Type::Tiny constraint system has a lot of potential.

Timm Murray announced Perl modules for controlling unmanned drones.

Tokuhiro Matsuno received far too little attention for his work with Compiler::Lexer. See his CLI for Compiler::Lexer for more details.

VM Brasseur and Jeffrey Thalhammer (the man who was approximately everywhere in Perl in 2013) announced the Perl Companies Project, a single place to list all of the companies using Perl.

Testing guru and frustrated economist Ovid explained the lack of good developers and the surprising lack of rise in programmer wages. Programmers need to learn more practical math.

The members of the Parrot Foundation voted to dissolve the foundation and let TPF take over. This puts the copyrights, governance, and other artifacts of the Parrot VM and its projects under the supervision of the Perl Foundation.

The Polish Perl Workshop 2013 took place in Warsaw, Poland. Videos of the Polish Perl Workshop 2013 are available online.

June 2013

Stevan Little announced the resurrection of his efforts to add a proper MOP to Perl. The code progressed throughout the year, as did Peter Martini's patch for proper function parameters in Perl. While neither one is yet suitable for either inclusion in the core or general deployment to production, their progress is heartening. In particular, Damien Krotkine's exploration of p5-mop as a user is a great example of what will soon be possible in Perl. (Stevan Little's porting a Moose module to p5-mop is also interesting, if a little more esoteric.)

The French Perl Workshop 2013 took place in Nancy, France.

YAPC::NA 2013 took place in Austin, Texas, USA. Brian Wisti gathered links to YAPC::NA 2013 slides and videos. Todd Rinaldo uploaded YAPC::NA talks on YouTube.

Aristotle Pagaltzis reflected on a decade of Module::Build in the Perl core. Module::Build will likely leave the core by 5.22.

July 2013

Fred Moyer announced the imminent release of SOAP::Lite 1.0.

Chad Granum released Fennec v2, an advanced testing system for Perl. Perl Maven interviewed Granum about Fennec. Between his work and Ovid's on Moose-based testing, the time may be ripe for a new testing book.

Jessy Shy published an announcement about, an app for home schoolers.

Tatsuhiko Miyagawa's Carton tool for managing CPAN dependencies reached 1.0 status. Miyagawa published his Carton slides from OSCON 2013 and the Carton 1.0 release announcement.

The music fan and hacker known as Barbie addressed frequently asked questions about CPANTS and CPAN Testers.

Brian Medley announced, a startup site written in Perl.

The patch -p0 hackathon took place in Paris, France.

August 2013

Perl 5.18.1 was released.

Yuki Kimoto published the release announcement of GitPrep 1.2, a free software replacement for Github.

The Perl Foundation accepted Nicholas Clark's grant to improve the Perl core.

YAPC::EU 2013 took place in Kiev, Ukraine. All of the slides of YAPC::EU 2013 are available online.

The Beijing Perl Workshop 2013 took place in Beijing, China.

September 2013

Toby Inkster announced the inagural monthly Planet Moose roundup of the news in the Moose/Mouse/Moo/Mo/M/whatever worlds. went live with a new version. Of course it uses Perl and the CPAN. The rainturk release announcement included a sizable discount for Perl community members.

The Helios distributed job processing system announced the Helios 2.61 release. This software is available from the CPAN, of course.

Dave Cross released a new version of his Perl-specific search engine.

YAPC::Asia 2013 took place in Tokyo, Japan. The YAPC::Asia 2013 recap is worth reading.

October 2013

Tom Christiansen and brian d foy spent time working on Perl::Critic policies based on recommendations from the 4th edition of Programming Perl.

Perl TV published Larry Wall's talk on Why Perl Is Like a Human Language.

Joel Berger announced the release of PDL 2.007. This release adds 64-bit support. David Mertens gave an introduction to the Perl Data Language and PerlTV posted it.

Shawn Moore mentored the incredible Upasana Shukla in removing string exceptions from Moose. This is a great achievement. Shawn's retrospective of the structured exceptions project is also worth reading.

The DadaMail Project (a modern mailing list manager written in Perl and released under the GNU GPL) released DadaMail 6.7.0.

The TWiki project announced the TWiki 6.0.0 release. This is a venerable Perl project.

The Open Source Development Conference France 2013 took place in Paris, France.

The Open Source Developers Conference New Zealand took place in Auckland, New Zealand.

The Pittsburgh Perl Workshop 2013 took place in Pittsburgh, Pennsylvania, USA.

The Perl Community Workshop 2013 took place in Frankfurt, Germany.

The Portugese Perl Workshop 2013 took place in Lisbon, Portugal.

November 2013

Jeffrey Thalhammer (the creator of Perl::Critic launched a public beta of his Stratopan service. Stratopan lets you freeze a stack of CPAN modules as development and deployment targets.

John Napiorkowski announced the Catalyst 5.90050 stable release.

The team behind Padre, a Perl IDE, announced the release of Padre 1.0.

Foswiki announced the release of Foswiki 1.1.9

Tudor Constantin announced Built in Perl, a web site listing companies that rely on Perl. Add your own company!

Peteris Krumins announced that No Starch Press has published Perl One-Liners.

Perl TV posted Larry Wall's 5 Programming Languages Everyone Should Know video.

Core hacker Yves Orton posted a technical explanation of the hash security changes in Perl.

YAPC::Brazil 2013 took place in Curitiba, Brazil.

The Austrian Perl Workshop 2013 took place in Salzburg, Austria.

The Nordic Perl Workshop 2013 took place in Copenhagen, Denmark.

The London Perl Workshop 2013 took place in London, UK.

December 2013

December is Advent season in the Perl world. That means lots of Advent calendars, with a post a day for 24 (or 25) days. Some of these calendars include the Perl Advent calendar, the Catalyst Advent calendar, and (new this year) the Futures Advent calendar. Even though Advent season is over, that's still enough articles to fill the rest of the month with good reading.

The Dancer developers sadly couldn't get their Advent calendar going (for happy, family reasons, so they get a pass this year), but they did announce the Dancer 2 0.11 release.

Perl turned 26 years old.

brian d foy announced the 2013 White Camel winners. Congratulations to Thaigo Rondon, Fred Moyer, and Dijkmat's Wendy and Liz. All of these winners have deserved this award for many years.

The Perl Foundation accepted Dave Mitchell's grant to maintain the Perl core.

Steffen Mueller announced the release of Sereal v2. Sereal is a serialization mechanism for data that's much faster than Data::Dumper and Storable, not to mention much safer.

Neil Bowers compiled The CPAN Report 2013.

patch -p1 took place in Paris, France.

The Saint Perl 2013 workshop took place in Saint Petersburg, Russia.

The Perl NOC (Ask and Robert) announced year end maintenance for services. Usually you don't notice when they do their (unsung and impressive) work.

That's it for a great year in Perl!

Suppose you're working on a large application in Perl. Your code is in multiple files with multiple packages, and you've built your application in layers. You have a data storage layer, a framework to manage control flow, a layer for business rules, and at least one form of user interface.

Imagine someone discovers a bug. When a user attempts to log in but mistypes her email address—using a comma instead of dot, for example—the web site crashes. She sees a nearly empty "500 Server Error" page instead of the attractive error pages the designer created and the logs show only that something went wrong. Your custom error handler didn't even get called.

If that sounds familiar, you may have had a week like I did.

Back when Perl and Java seemed like two poles of the professional software development axis, we Perl programmers often teased Java programmers about Java's propensity to emit page long backtraces whenever anything somewhere went wrong. Over a decade later, my views have grown to include a little more nuance. The problem isn't backtraces per se; the problem is Java's call stacks are so deep and the stack traces so verbose that real problems may be obscured in irrelevant details.

Perl code sometimes goes too far the other direction. It makes sense to use Carp's carp() to warn about the dubious use of code in libraries from the point of view of the caller, but modern Perl applications tend to grow beyond a single program calling to a few libraries. Our libraries depend on other libraries and something can go wrong in one layer but only produce an error in another layer. Sometimes it's nice to have the option to enable verbose backtraces for warnings and errors only temporarily, during debugging, without modifying any of your code.

That's what Carp::Always does. If you can reproduce the error in a test case (whether a formal test script or a small, standalone program), launch the program with the command line option -MCarp::Always to get a verbose backtrace on warnings or errors.

(The -M flag tells perl to load a named module, just as if you'd written use Carp::Always; in your program.)

For bonus debugging powers, I like to use command lines of the form:

$ perl -MCarp::Always 2> log; less log; rm log

... so that the backtrace goes to the less pager, where I can scroll up and down and search. When I quit the pager, the temporary file goes away so it doesn't clutter up my directory.

By tracking all control flow to the point of the error, I found the problem more quickly. You can, of course, solve this problem in multiple ways, including attaching a debugger to a running process, but when that's not an option and when you can reproduce the exception or warning in a small test file, forcing a full backtrace can be very helpful.

chromatic is the author of Modern Perl: the book. His non-programming hobbies include gradually curating a list of smoothie recipes and value investing.

Visit the home of the Perl programming language:

Sponsored by

Monthly Archives

Powered by Movable Type 5.13-en