| Subcribe via RSS

Perl Module Monday: Data::Section

December 28th, 2009 | No Comments | Posted in CPAN, Perl

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: , ,

No PMM Post This Week

December 21st, 2009 | No Comments | Posted in Perl

There will be no Perl Module Monday this week, as I’m on vacation for the holidays and haven’t had the time to research and select a module this week…

Tags: ,

Perl Module Monday: Linux::Inotify2

December 14th, 2009 | 1 Comment | Posted in CPAN, Perl

Here’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: , ,

Perl Module Release: RPC-XML 0.72

December 13th, 2009 | No Comments | Posted in CPAN, Perl, Software, XML
Version: 0.72 Released: Sunday December 13, 2009, 09:45:00 PM -0700

Changes:

  • Makefile.PL
  • t/40_server_xmllibxml.t

RT #52662: Fix requirement specification for XML::LibXML.

  • lib/RPC/XML.pm

Some more clean-up of the docs, removing a redundant section.
Tags: , , ,

Perl Module Monday: File::Tail

December 7th, 2009 | 1 Comment | Posted in CPAN, Perl

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: , ,

Perl Module Release: RPC-XML 0.71

December 7th, 2009 | No Comments | Posted in CPAN, Perl, Software, XML
Version: 0.71 Released: Monday December 7, 2009, 08:00:00 PM -0700

Changes:

  • MANIFEST
  • t/01_pod.t (deleted)
  • t/02_pod_coverage.t (deleted)
  • t/03_meta.t (deleted)
  • t/04_minimumversion.t (deleted)
  • t/05_critic.t (deleted)
  • xt/01_pod.t (added)
  • xt/02_pod_coverage.t (added)
  • xt/03_meta.t (added)
  • xt/04_minimumversion.t (added)
  • xt/05_critic.t (added)

Moved author-only tests to xt/, updated MANIFEST.
  • MANIFEST

Add test suite 28_parser_bugs_50013.t, which was omitted from last release.
  • xt/01_pod.t
  • xt/02_pod_coverage.t
  • xt/03_meta.t
  • xt/04_minimumversion.t
  • xt/05_critic.t

Re-engineered the author-only/release tests, since they're no longer in the t/ directory and thus should not interfere.
Tags: , , ,

Perl Module Release: RPC-XML 0.70

December 6th, 2009 | No Comments | Posted in CPAN, Perl, Software, XML
Version: 0.70 Released: Sunday December 6, 2009, 10:00:00 PM -0700

Changes:

  • lib/RPC/XML.pm
  • t/10_data.t

RT #49406: Make Base64 data-type allow zero-length data.

  • lib/RPC/XML.pm
  • t/10_data.t

Hand-applied a patch (most likely from Bill Moseley) to extend the construction of dateTime.iso8601 data-types.
  • t/40_server.t

Fixed another corner-case for the url() test.
  • lib/RPC/XML.pm

Fixed a case from previous work that caused "undef" warnings.
  • lib/RPC/XML.pm
  • lib/RPC/XML/Parser.pm
  • t/28_parser_bugs_50013.t

RT #50013: Restore backwards-compatibility for projects that use RPC::XML::Parser directly.

  • lib/RPC/XML/Procedure.pm

RT #50143: Incorrectly called server_fault() as if it were a coderef.

  • lib/Apache/RPC/Server.pm

Applied patch from Frank Wiegand to fix a POD problem.
  • lib/RPC/XML.pm

Some additional regexp issues on dateTime.iso8601, to handle backwards-compatibility.
  • lib/RPC/XML/ParserFactory.pm

Fixed some minor doc errors.
  • lib/RPC/XML/Parser/XMLParser.pm

Moved the 'require' of some libraries to the point where they are first needed, to delay loading until/unless necessary.
  • lib/RPC/XML/Parser/XMLLibXML.pm (added)
  • t/21_xml_libxml.t (added)
  • t/29_parserfactory.t
  • t/40_server_xmllibxml.t (added)

Implement support for XML::LibXML in the parser-factory.
Tags: , , ,

Advents, Advents Everywhere

December 3rd, 2009 | 1 Comment | Posted in Perl

Perl seems to always lead the language-pack in terms of Advent Calendars each year. Here are a few that I know of, that I’m following daily:

Go forth and, errr, advent…

Tags: