New Project: ziprip.js

I've been playing with JS a bit recently, and have released a client-side library for extracting postal addresses and geocoords from webpages - it's intended for use in bookmarklets and browser extensions:

I've also made it work with node.js - which means it's installable via npm. For what it's worth, it's considerably easier to create a new user account for node packages (no human intervention step), and there's a built-in publish tool...

YAPC::NA 2012 - The Survey Results

The Conference Survey Results for YAPC::NA 2012 are now online.

Many thanks to the 165 respondents, who made up 37% of the attendees. Although the responses only feature a third of the attendees, they do appear to cover a complete mix of experience, and present a good cross-section of attendees. As has been observed in previous years the average age of the attendees is getting older. That's not to say we aren't bringing new people into the community and the conference circuit, but it seems that Perl is a language people are getting into enough to attend events like this from their late twenties. In 2012, YAPC::NA had it's biggest attendance so far, so Perl is definitely growing its community. Hopefully events like YAPC are encouraging more and more people to learn more about Perl and the community. Looking at the demographics of the respondents, it's not too surprising to see the popular job roles and industries listed. However, it is encouraging to see Perl is being used in many different industries.

AnyEvent::Capture - Synchronous calls of async APIS

Cage7.jpg I’ve been a busy little bee lately, and have published a handful of new CPAN modules— I’ll be posting about all of them, but to start things off, I bring you: AnyEvent::Capture

It adds a little command to make calling async APIs in a synchronous, but non-blocking manner easy. Let’s start with an example of how you might do this without my shiny new module:

 use AnyEvent::Socket qw( inet_aton );

 my $cv = AE::cv;
 inet_aton( 'localhost', sub { $cv->send(@_) });
 my @ips = $cv->recv;
 say join ".", unpack("C*") for @ips;

The above is not an uncommon pattern when using AnyEvent, especially in libraries, where your code should block, but you don’t want to block other event listeners. AnyEvent::Capture makes this pattern a lot cleaner:

use AnyEvent::Capture;
use AnyEvent::Socket qw( inet_aton );

my @ips = capture { inet_aton( 'localhost', shift ) };
say join ".", unpack("C*") for @ips;

The AnyEvent::DBus documentation provides another excellent example of just how awkward this can be:

Updates to five of my CPAN reviews

I've updated five of my CPAN reviews, adding new modules and updating where new versions of modules have been released.

I've added the ability to comment at the end of each review, using disqus. Following a suggestion from Ben Bullock, module names in the summary table now link to the review section for the module, and there's a separate link for the module's doc.

Devel::Trepan Debugger evaluation of Perl statements

In the last blog, I started describing features that are new in Devel::Trepan that aren't in perl5db. Here I will continue with one more: the evaluation aspects of the debugger REPL (read, eval, and print loop).

By default, when you type something that isn't a debugger command the debugger just tries to evaluate the string you gave it. If what you typed was really a mistyped debugger command you might get a weird error message. For example:

(trepanpl): stp
Unquoted string "stp" may clash with future reserved word ...

If you don't want this behavior, you can turn off "auto eval". And here is what happens then:

(trepanpl): set auto eval off(trepanpl): stp
** Undefined command: "stp". Try "help".

By the way, bold and underline really is what you get in the debugger if the terminal you are using supports underlining and bold.

Now let's go back and type some Perl commands to be evaluated and let us see what happens.

Hacktivity report (Apr-Jul 2012)

The original plan made at the end of March of working on the Sah data validation framework and form processing framework didn't happen. In April and May I released fewer CPAN distributions due to vacation.

In May and June a majority of my Perl hacking time is spent around the transaction specification in Rinci and Riap, plus a framework/generator for creating functions that support undo/transaction, because writing such functions directly has become too complex and error prone. I have completed the specification, and converted a few Setup modules to using it (the rest will follow). A demo script has also been created and blogged about.

In July I released several modules to add Log::Any logging to various things: Log::Any::For::LWP, Log::Any::For::DBI, Log::Any::For::Builtins. Now displaying detailed logging is just a single line away.

Some other things which I worked on during this period:

CPAN ratings

There are a couple of indicators I take into account when evaluating perl modules.

  • Update frequency and date of last update
  • Usually I look at the source and check for existance of test files.
  • The next step would be to check cpantesters results.
  • Some cpan authors are known for writing quality code
  • Also helpful sometimes are the cpan ratings.

I just wanted to submit ratings for some of the modules I really like but “failed” to do so because apparently it requires a bitcard login.

Q: What is bitcard and why can’t I use my PAUSE login?

Bitcard is an open single-sign-on web-authentication service. It’s free for both users and web sites. It is used by most services.

Ideally I would like to use one account for all perl services. If I click “login” on, cpan, … a small disclaimer that bitcard is used in the background would suffice.

PS: after proofreading this post I’d like to make sure no one feels offended. So don’t!

remember GCL?

Some of you witnessed me last August standing in front of the great Perl congregation at YAPC::EU and talking a lot of steamy hot air out of my mouth. More precisely how nice it would be to have a DSL for GUI creation like Rebol has it. I just turned hulky green (but without the muscles) of envy when I saw how much less syntax they need to define GUI. Especially if you use the super verbose Wx. (But it looks just better :) ). As I currently do a lot for the rewrite of Kephra, make him most modern, super mighty, tight and duper I found myself currently writing some helper modules that might serve as a basis of that DSL I call GCL - GUI Creation Language.

I will speak again about it, but since there will be no other track beside it, I can give now away some of the wow points. What I created just the last days (last commit) is a sizer class that has several advantages.

About 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 hosted by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.