What does CATALYST_DEBUG do?

Introduction

I used to think that CATALYST_DEBUG was an all-reaching magical environment variable that somehow affected the ‘Come back Later’ screen as well as what messages were output via $c->log->...().

I’ve educated myself since then but I’ve always thought it would be an interesting exercise explicitly exploring and documenting the various behaviour under different conditions.

The Code

Code for this example can be found in the catalyst_debug branch.

After each change we run ./script/demo_server.pl with various settings and note the results.

Basic Death

What do we see if we have an action that dies?

Edit lib/Controller/Root.pm so that the index() dies (af2a29e):

sub index :Path :Args(0) {
    my ( $self, $c ) = @_;
    die 'Shot through the heart!';
    $c->response->body( $c->welcome_message );
}
ENV variables script options Result
    Error Screen
CATALYST_DEBUG=0   Come Back Later
CATALYST_DEBUG=0 -d Error Screen
CATALYST_DEBUG=1   Error Screen

Remove ’-Debug’ plugin

What happens if we don’t force the -Debug plugin?

Edit lib/Demo.pm and remove the -Debug Catalyst plugin (4fa87c0):

We’re pleased to announce that Shutterstock has become...



We’re pleased to announce that Shutterstock has become Gold Sponsor of YAPC::NA 2012. Shutterstock loves Perl.  They’re a stock photo and video company, and are at the forefront of technology and research.  They do fascinating things with search, discovery, recommendation engines, and scalability.  They’re looking for really smart people and great engineers to help them to continue to be a leader in the industry.  They focus on fast, iterative development (over 150 deployments/month) and collaborative, interactive programming. Developers work on small cross-functional teams (4-6 people) that have a voice in setting their own priorities and are expected to build and deploy applications quickly and iteratively.

If that’s not enough, check out these other perks:

  • All the hardware you want:  Their philosophy is that hardware is cheap compared to your time.  If you think it will increase your productivity, they’ll buy it for you.
  • Professional development:  The more you know, the more valuable you are to them.  So you’ll get any tech book you want, and they’ll reimburse your tuition for classes.
  • Lots of free goodies: Breakfast, fruit, pizza on Fridays, and even massages.

Interested?  E-mail techjobs@shutterstock.com.

Updates to CPAN module reviews

I've updated all of the CPAN module reviews I've done so far. In all of them the performance and coverages tests have been re-run.

Modules for generating passwords
  • Data::Random has a new maintainer, Buddy Burden, who just released 0.06 (and made his first post here.
  • App::Genpass 2.20 has been released: this adds minlength and maxlength parameters.
Looking up the location of an IP address
  • Added Geo::Coder::HostIP, which I'd missed previously. I've put a bug-fixed version on github, and have started the process to get co-maint, so I can release an update to CPAN.
  • A new version of IP::QQwry has been released.
Spelling out numbers in English
  • I've taken over maintenance of Lingua::EN::Numbers, and resolved all outstanding issues.
Parsing User-Agent strings
  • I've taken over maintenance of HTTP::Headers::UserAgent and released a new version which is more clearly marked as deprecated (and also fixed some bugs and improved test-suite coverage.
  • New versions of HTTP::BrowserDetect and Parse::HTTP::UserAgent.

Marpa::XS release candidate now available

I am very happy to announce that the latest release of Marpa::XS is a release candidate for the first full release, Marpa::XS 1.000000. Most user's experience with the previous beta releases seems to have been trouble-free. The one significant issue that was identified was a failure to properly evaluate null symbols under an unusual combination of circumstances. This problem (a one line error in the C rewrite of the parse engine) is fixed in this release. Unusual as the issue is, when it does occur it results in a parse failure, so that I recommend that all users of Marpa::XS upgrade to the latest release.

Marpa::XS is being kept stable. Bug fixes, even of minor and cosmetic bugs, will be made, as will changes that improve maintainability. But no new features will be added. Interface changes will be especially avoided.

What is Marpa?

Marpa is an advance over recursive descent and yacc. I hope the Marpa algorithm will become the standard parser for problems too big for regular expressions.

MongoDBI, ... I made it, go check it out!

I'm a little burnt out from doing client work, working on MongoDBI all last week, writing code then documentation, ... so, yup, MongoDBI, MongoDB ODM, I just started it, check it out, .. leave comments if you're not too burnt out.

Click Me - Synopsis

If you look on every exit as being an entrance somewhere else ...

I didn’t write anything specifically about Perl this week, but I did broach a topic in my other blog that you may find interesting if you’re a professional programmer.  Check it out, if you like, or not.  If nothing else, it has a reference to a great blog post which is much better than mine. ;->

13 Days to Christmas, and 6 Months to YAPC

Now would be a great time to remind your family that what you really want for Christmas is an all expenses paid trip to YAPC::NA 2012!

The dates are June 13-15 in Madison, Wisconsin. And while they’re at it, they should also send your spouse with you to enjoy the Spouses Program.

The Triumphant Return of Zoidberg -- A Modular Perl Shell

After more than a year of hoping to be able to say this, here goes: Zoidberg is back!

What is Zoidberg you ask? Well its a Perl shell, of course. Think of the fun of it all:

mv($_ => lc($_)) for grep /[A-Z]/, <*>

If you use a reserved Perl word first or if you wrap code in a block it is interpreted as Perl, if not then its a shell command. Along with having most of the things you would expect from a shell, it features plenty of extra bells and whistles, like a multiline input system (when Term::ReadLine::Zoid, part of Bundle::Zoidberg, is installed) and automatic splitting of variables to arrays like @PATH which is just $ENV{PATH} split on :.

When used as your login shell, it can be used from inside other programs like vim.

:!cat % | {/^\S/}g | wc -

Further, it is easy to extend with the Zoidberg::Fish plugin system.

Read plenty more about it in a couple of rather old, but still relevant articles:

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl and offering the modern features you’ve come to expect in blog platforms, the site is run by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.