Baby XS to get you started

Joel Berger will give a talk at YAPC::NA 2012 described as:

I am no expert in XS, nor am I am expert in C, but events conspired to force me to learn. What I found is that while XS can be used as a language all its own, it can also look and feel very much like C.

In this talk I will present a minimal subset of XS needed to get started. I will present some “easy” idioms and rules-of-thumb to keep XS from becoming overwhelming. Best of all, its still real XS, so you can add all the full-power XS you want later! 

If you would like to learn enough to start a small XS project, come see this talk.

[From the YAPC::NA Blog.]

App::TimeTracker 2.014 and CPAN::Mini::FromList 0.04

Wow, the new year starts with a lot of collaboration!

Today I got two IRC messages from people who added features / fixed bugs in two of my CPAN modules. Only now I had the time to take a closer look at the requests, merge them and push the new version to CPAN and github.

You can read more about the new version of App::TimeTracker in the App::TimeTracker Blog (Thanks, plu)

CPAN::Mini::FromList is a rather old dist I hacked up during the Oslo QA Hackathon, and it seems that it's still in use up there, as Salve submitted a patch that I just had to merge and than `dzil build`.

Only slightly related: A big THANK YOU is also due to the nice members of the #catalyst IRC channel, who (again) answered my question in no time.

Testing Updates

Test::More::Prefix works with new Test::Builder

One of the CPAN testers appears to have picked up that there's a new Test::Builder... Test::More::Prefix knew a little too much about how the old one worked, so there's a new version that handles whichever you have installed...

New Test::BDD::Cucumber

Which worries me that the new Test::BDD::Cucumber, which has loads of fixes, and now passes the core parts of the Cucumber TCK suite, may need a bit of wrangling to work with it...

Automatic generation of Cucumber from code

And if you're in the last bit interested in Cucumber, you might find my article on generating Cucumber automatically from code blocks interesting...

Debugging Memory Use in Perl - Help!

Hey,

Cross-posting this from a Stack Overflow Question asked by a colleague.

We will be having a Perl Foundation Party at YAPC::NA 2012 this...



We will be having a Perl Foundation Party at YAPC::NA 2012 this year. At the banquet we’ll hand out clubbing shirts. They light up and animate like the image above. That will be your ticket to get into the party.

The party itself will be hosted a few blocks away at a nightclub called Segredo. If you show up wearing the shirt we’ll let you in to the VIP lounge where you can get your first few drinks for free!

This party is being sponsored by a donor who would like to remain nameless. However, they’d like to encourage you to give generously to the Perl Foundation

[From the YAPC::NA Blog.]

Beginning Perl - Table of Contents

Because people keep asking for it, I asked Wrox if it was OK to share the table of contents and they said "sure!".

Please note that this is in flux. Chapters 1 through 7 are written, along with most of Chapter 8. Everything after that is very much subject to change (which is why the TOC isn't even formatted for those chapters). Also, you'll note the lack of Unicode. That was going to be in Chapter 7, but I've moved it to Chapter 9 and haven't update the table of contents yet.

Solaris build problems... help?

Hello. I am needing some help to understand some cpan testers build failures under Solaris. The reports are:

If you have any idea on what is going on, please post here a comment, or mail me.

perlformance

For some weeks I now have my Perl benchmarking ready.

It is a whole little infrastructure, based on Tapper and Codespeed, an own not regularly updated CPAN mirror (to keep dependencies stable), and a dedicated benchmark machine.

One server (perlformance.net) is running the Tapper result database, the Tapper website, the codespeed graph rendering website and the CPAN mirror.

The second server (perl64.org: 6 core AMD Opteron 4180, Debian/Squeeze)
is dedicated to only run benchmarks, without any disruption from email, web,
or other services. I also took care of disabling all OS features that typically lead to deviation, like ASLR and Core Performance Boost.

Learn about the overall vision from my YAPC::EU 2011 slidedeck.

The benchmarks are produced by Benchmark::Perl::Formance.

Perl IPC: Power of Communication

Jason May will give a talk at YAPC::NA 2012 described as:

This talk will introduce common ways of using Perl to have processes communicate to each other.  It will cover things like how to communicate between parent/child processes and between completely separate processes, whether it is on the same host or a different one. It will also cover libraries and tools that facilitate building and testing these aspects, such as Reflex, AnyEvent, and netcat.

Common examples that are applicable to each aspect of the talk will be discussed, such as coordinating processing information in parallel, working with job queues, and establishing gateways.  Demonstrations, useful references, and caveats will be provided along the way.

[From the YAPC::NA Blog.]

Announcing Module::UseFrom

So what do you do when you need to load a module from a string? Do you do eval "require $module"? Well as many of you may have read, that is How (not) to Load a Module. This mechanism is unsafe in certain situations, but sadly there hasn’t been a good answer for it.

What do you do when you want to load a module only if it is installed, or only if it is of a certain version or higher (without dieing). Of course there are eval ways around that too, but could they be easier?

This post announces Module::UseFrom, which lets you do all of these things. But it gets better! All of these actions are done using the much safer bareword form of use, accomplishes this at compile time, and does it without any evals[1]!

It does all this using Devel::Declare to inspect a package variable in your module and inject a bareword use statement. This means that it avoid most (all?) of the problems Schwern’s post (above); if it fails to create the right statement, perl (yes lowercase) dies on the use Bareword::Module statement.

Check it out, fork, comment etc. https://github.com/jberger/Module-UseFrom

Happy New Year everyone!

[1]: ok, there is a s///e, but its for convenience, and its safe.

What you should know about signal based timeouts

The problem

I think we've all seen code like this example from perlipc:

my $ALARM_EXCEPTION = "alarm clock restart";
eval {
    local $SIG{ALRM} = sub { die $ALARM_EXCEPTION };
    alarm 10;
    flock(FH, 2)  || die "cannot flock: $!";
    alarm 0;
};
alarm 0;
if ($@ && $@ !~ quotemeta($ALARM_EXCEPTION)) { die }

Perl documentation is Awesome

Perl in Pop Culture

Watch the last 30 seconds of this video.

Learning Perl, 6th Edition book review most popular of 2011

The "Learning Perl, 6th edition" book review had the distinction of being iProgrammer's most popular review of 2011, between more than 250 reviews on a vast variety of subjects with thousands of reads each, but the Perl review reached top spot with 10,800 reads (figure untill 29/12/2011)
The benefit is that it exposed the language to a wide audience, since the site appeals to a general programming public from C# to Javascript, therefore I do hope that it managed to attract "new blood" and/or converts !

YAPC::Europe 2012 still alive

We are still alive!

Our silence regarding the progress and especially
the venue location and conference dates is owed to the restrictions of
the planned venue which explicitly forbids mentioning the date and
place before the contract is signed by both parties.

We didn't keep up with the post frequency after the first blog posts,
but as the contract should be signed at the start of January 2012, you
should see more frequent updates from us again. We can't promise to compete with the excellent communication of YAPC::NA 2012 though.

We wish you a good start in 2012 and hope to see you in Frankfurt!

Tinkering with a (safe) string use

I read Schwern’s post How (not) To Load a Module just as I was wanting to dynamically load different Module::Build subclasses for different OSes. It struck me just as odd as it seems to for everyone that use-ing a module from a string should be so hard.

In my spare time, I have been working on some use problems using Devel::Declare and it gives some intersting hope here. Preliminarily I am calling it UseX::Declare but hopefully someone will come up with something better. Basically it provides a function called use_from which acts like:

use UseX::Declare;
BEGIN {
  our $var = 'Net::FTP';
}
use_from $var;

Through the magic of Devel::Declare, the parser sees:

Linode is sponsoring a beer party at YAPC::NA 2012. We’ll...



Linode is sponsoring a beer party at YAPC::NA 2012. We’ll have beer, wine, soda, and water available for an hour before the banquet at YAPC this year. Thanks to Linode for being so generous!

[From the YAPC::NA Blog.]

New Lingua::Identify::CLD

As if I did not have enough modules to take care already, I just started a new one. It is still on its beta version as I did not have much time to test it, and write a decent API. It is available in the usual place: https://metacpan.org/release/AMBS/Lingua-Identify-CLD-0.01_01

This is an interface to a library by Google for language detection. As far as I could understand, it is part of the Chrome browser, and was just released as open source. Details here: http://code.google.com/p/chromium-compact-language-detector/

It is available at GitHub, and I am happy to receive issues or pull requests. Just bear in mind that no API is still defined (although I have an idea of what I want) and that I do not have much time to solve your issues right ahead.

Finally, a thanks to Jean Véronis that pointed me the library and asked kindly for a Perl interface to it.

Syntax Highlighting Perl Debugger on github

You may have seen this:

Perl Debugger with Syntax Highlighting

I had debugger syntax highlighting working before, but I overcomplicated it and never figured out how to approach the problem.

I was inspired to try again by Mithaldu's post about augmenting the debugger. Once I realized that I had a much better strategy than previously, the code was straightforward.

I tested it on 5.12.2. I offer no guarantees. It's on Github as DB--Color. You don't like it? Fix it :)

++ Goes on Hiatus

If you saw @kraih's recent MetaCPAN tweet, you'll know that MetaCPAN's ++ feature has been gamed. Now, we were aware there was some potential for gaming. Initially you needed a PAUSE id to be able to ++, but this had an unexpected side effect in that there were some requests for PAUSE accounts with the justification of "I'd like to be able to ++ on MetaCPAN". Because this placed an additional burden on the already busy PAUSE admins, we were asked to remove this requirement.

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.