Perl Module Release: Env-Export 0.21
Released: Sunday April 25, 2010, 10:10:00 PM -0700
Changes:
- lib/Env/Export.pm
Code clean-up inspired by perlcritic.
A preponderance of Perl, an excess of XML, and additional alliterations.
| Subcribe via RSS
Changes:
Code clean-up inspired by perlcritic.
Changes:
Large-scale code and documentation clean-up based on perlcritic
and visual review.
Version: 0.73
Released: Tuesday March 16, 2010, 10:45:00 PM -0700
Changes:
Rename of t/28_parser_bugs_50013.t to fit more universal scheme for
test suites that directly address specific RT bugs.
RT #54183: Provide handling of SIGPIPE when sending the response to the client,
in case they’ve terminated the connection.
Forgot to add the new test suite to MANIFEST.
Forgot to update the module version number.
Fix typo in reftype() call.
RT #54494: Fix handling of blessed references in smart_encode().
Large-scale code clean-up driven by Perl::Critic. All critic flags
down to severity 1 now removed.
Forgot to add t/90_rt54494_blessed_refs.t when it was created.
For this week, I’m turning the first of several modules I was introduced to by reading RJBS’ Advent Calendar. This module scratches a particular itch that I’ve had on several occasions, including fairly recently.
Data::Section, in simple terms, turns your __DATA__ section into a hash-table of strings keyed by indexes you choose. It gives you a clean, programmatic way of having multiple “mini-data” sections within the main one, in a fashion similar to Inline::Files (but without the niggling caveat that it could overwrite your source files). The author notes that it was originally envisioned as a way for modules to store their own (multiple) templates, which is a task I’ve had to deal with before. But it would be useful anywhere you want to store large chunks of text data, without resorting to here-documents. It also allows for inheritance of data from a module’s super-classes that also use Data::Section, allowing a class to re-use existing data and only “declare” the extra sections it needs, or those sections that need to be different. You can learn more at the advent entry for this module.
I already have a small CGI app that will be getting the Data::Section treatment, and I hope it can be useful to you as well.
Tags: CPAN, module-monday, PerlHere’s another short one this week…
I first learned about Linux::Inotify2 from a posting on acme’s blog. It’s a neat interface to the Linux Inotify system, which itself is basically a way of being informed whenever things happen in the file-system.
I was able to make use of this almost immediately– I took the sample script from acme’s post and made a few adjustments, then used it to look at the libraries that Image::Size loads during start-up. Turns out that there were a couple of them that didn’t need to be loaded until/unless needed, and once I saw this I was able to move them around and speed up the compile-time phase of the module.
This module has some great potential for monitoring, measuring, etc. I’m toying with a graphical version of acme’s script that I can have running during test suite runs, to get a better idea of other places I can improve things.
Check out the module, and check out acme’s original post on the subject, too!
Tags: CPAN, module-monday, Perl
Changes:
RT #52662: Fix requirement specification for XML::LibXML.
Today, a short one as I’m short on time. But I wasn’t able to do a PMM last week, and I’d hate to skip it two weeks in a row, so…
Say hello to File::Tail. A simple concept, but a very, very useful one. Ever run the *NIX “tail -f <file>” command? Yeah, it’s pretty much just like that. Only in Perl, so it’s actually more flexible. Much more.
You can use it in a very simple manner, to read from files that are continuously updating. You can control how often and to what degree it adjusts the wait-interval it uses when polling the underlying file to check for changes. You can also tie a file-handle to it. You can do things like select-polling across several such handles or objects, to read in a non-blocking way from multiple tail’d files at once. It even comes bundled with two sample scripts showing it in action.
Check it out!
Tags: CPAN, module-monday, Perl
Changes:
Changes:
RT #49406: Make Base64 data-type allow zero-length data.
RT #50013: Restore backwards-compatibility for projects that use RPC::XML::Parser directly.
RT #50143: Incorrectly called server_fault() as if it were a coderef.
I’ve been interested in the Chart::Clicker package for a while, and today it came up in a series of Twitter messages in my #perl search. So that seemed like a sign that it would be a good pick for this week’s feature.
Chart::Clicker is a mature, very feature-rich charting package that comes with a cookbook and many examples (the code for the examples is available on GitHub). There’s also a tutorial POD in the distribution. It does pie charts, line graphs, bar graphs, area graphs, stacked bar or area or line graphs, points, bubbles, or candlestick-style charts. In short, it makes pretty pictures in Perl:
The above is just one of the images shown as examples of what Chart::Clicker can do.
The module bases its rendering on Graphics::Primitive, specifically Graphics::Primitive::Driver::Cairo. This means it can render the chart in any format Cairo supports; PNG, PDF, even SVG among others. The internal object-model is based on Moose, which leads to keeping potentially-duplicate code to a minimum. Using the package is about as complex as you need your graph to be: a simple graph with a single set of data can be created in just 5 lines of code or so, while some of the examples are much more complicated scripts.
I’m surprised to see (according to CPANTS) that this module is not a component in any other packages’ lists of dependencies. It would seem to me to be a logical bit of functionality to integrate into a Catalyst view, or any stats package. I won’t be surprised if this changes in the near future, as (hopefully) more people start using the package.
Tags: CPAN, module-monday, Perl