このページは大阪弁化フィルタによって翻訳生成されたんですわ。

翻訳前ページへ


blogs.perl.org ― blogging the onion
The Wayback Machine - http://web.archive.org/web/20121026043211/http://blogs.perl.org:80/

Alien::Base Perl Foundation Grant Report Oct

This month has been a good one for Alien::Base, and I’m happy to report that I believe that the grant is winding up. We saw a beta release and had a project night during which we hacked on a few issues, but also I was keenly observing people assessment of usability, which I consider key to the success of the project.

I think I have only a few issues to work out before I declare success:

  1. Fix a bug which has crept up on OpenBSD - I am almost certain this is related to my implementation of a parser for pkgconfig files
  2. Investigate a solaris bug reporting from the extended test chain (i.e. Alien::DontPanic and Alien::Ford::Prefect)
  3. Polish up my Alien::GSL distribution and release to CPAN as an example. BTW this was my project on project night, though with all my activity I didn’t get a whole lot done (visibly)

I think that it is conceivable that these last issues can be addressed this month.

"Essential Modern Perl" Track at Austrian Perl Workshop

(crossposted from http://domm.plix.at/perl/2012_10_essential_modern_perl.html)

To get more new participants to this years Austrian Perlworkshop we (Vienna.pm) came up with the following plan: On Saturday, 17th November, we will have one track of talks called Essential Modern Perl. We came up with ~15 topics that should introduce newcomers and old timers to the wonderful world of CPAN and the various toolkits and modules that lead to the Perl renaissance labeled Modern Perl.

We are still looking for speakers for some of the topics, so if you're near Vienna or need an excuse to visit us, just grab one of the currently un-assigned talks! Also, if you're a member of one of the core groups working on the listed modules etc and have a good presentation about the topic at hand, please let us know where we can find it (if we're allowed to reuse the slides...). We're looking for ~20 minutes introduction talks targeted at people that know programming, but do not necessarily know a lot of Perl.

If this track works out, it might be a good idea to have a similar track at as much workshops and conferences as possible. I hope it's a good way to lure new people into the Perl community. In a perfect world we'd have a repo of public slide decks covering the core topics, and orgas of events would "just" need to find some speakers to do the talks...

What do you think? Maybe there already is a repo containing those slides? Should we have such a track at a YAPC? At workshops?

Progress::Any

I usually implement "progress bar" in a command-line application via logging. For example:

use Log::Any::App qw($log);
$log->info("Starting ...");
for my $i (0..@items-1) {
    my $item = $items[$i];
    $log->infof("(%d/%d) Processing item %s ...", $i+1, ~~@items, $item);
    do_stuff($item);
}
$log->info("Finished");

Log::Any::App already gives me an easy way to output those log lines to screen and/or file. I can turn on the log by giving VERBOSE=1 or --verbose to my program. The log lines are printed with a timestamp, so I can guess how long a run will last.

Lately, however, I've been a bit annoyed by the long output of my gitbunch script. I currently have over 330 repos in my ~/repos, and syncing those to/from laptop always produces pages of output which I need to review by scrolling up, to see whether some repos failed to be synced.

Turning off verbose output (the green lines in the screenshot above) is also bad because the script will spend much time seemingly standing still. I usually run this script before having to rush out of the office, so I need to know just how many more minutes the script will run.

So, earlier today I finally separated normal logging and progress reporting, actually something which has been on my mind for quite a while. The two actions have real differences anyway, and explicitly saying one and the other is desirable. Progress indicators usually are more transient, do not need to be saved to log file, and can also be displayed more "creatively" rather than simply dumped linearly to the screen.

Looking at the available progress bar modules on CPAN and comparing with several Ruby progress bar libraries left me unsatisfied. I want something like Log::Any for progress indicators, not something that is specifically tied to command-line or terminal. I envision progress indicators over email, SMS, IM, twitter, or whatnot. The progress outputting functionality should be split from progress updating.

The result: Progress::Any. The first draft is already on CPAN and used by gitbunch. Two output modules have been written: LogAny (for outputting progress as log lines using Log::Any) and TermProgressBar (outputting progress as bar, using Term::ProgressBar). If no output module is specified, the default is Null output.

The code now looks something like this:

use Log::Any::App qw($log);
use Progress::Any qw($progress);
$progress->set_target(target => ~~@items);
for my $i (0..@items-1) {
    my $item = $items[$i];
    $progress->update(message => "Processing $item ...");
    do_stuff($item);
}
$progress->finish; # just making sure that we end with 100%

To assign an output:

Progress::Any->set_output(output => Progress::Any::Output::TermProgressBar->new);

Because Term::ProgressBar doesn't support displaying a message inside a progress bar, the messages in update() don't get displayed. But some other output, like LogAny can and do display the messages.

The output selection can be done from other parts of your code, making your core code free from visual configuration of progress indicators. Multiple outputs is also supported. Normal logging to screen can still be done. My CLI framework Perinci::CmdLine has even been updated to not interfere the bar display when logging to screen. Sample output of gitbunch program after using Progress::Any:

Reverting to outputting progress to Log::Any, as previously, is a matter of changing a single line of code (but this is something which is not implemented in Perinci::CmdLine yet, maybe if needed later).

Progress::Any has (or will have) other features too, like multiple indicators (for different tasks) and hierarchiecal progress (subtask, after finishing, will increment their parent task's progress). The output modules will let you configure the visual aspects, like, for TermProgressBar: how wide the bar is, the characters, the time/date format, and so on. Progress::Any itself will let you configure things like levels, maximum update rate, and possibly a few others. I'm still reviewing the API. Named parameters via hash is used throughout to be flexible and extensible, especially since the API and code are still young with some features lacking. Comments welcome.

I have also been contemplating about an event+notification API. It takes input from logging, progress indicator, explicit notify calls from applications, and even emails (like cron reports) and other sources (e.g. service up/down events, events from OS, external data from website, whatever), filters/summarizes/digests/remixes them as well as stores them in a central database, then notifies users. But that is really a subject of another blog post...

Domain-based session affinity/persistency

So, here is another pretty cool feature I've implemented. It might interest you if you use multiple domains with reverse proxies.

I was recently asked to add to Perlbal::Plugin::SessionAffinity the ability to allow consistent session affinity per domain. Hell, it's a paid feature so I took a look at it.

The idea is that if you have a lot of domains and you use Perlbal::Plugin::SessionAffinity in your Perlbal reverse proxy, you might get a fragmented cache because each user will reach a different (yet consistent) backend, regardless of the domain they requested. When someone has more than 300 domains behind the same reverse proxies (and let me tell you, some people actually do), this fragmented cache reduces efficiency.

So, now Perlbal::Plugin::SessionAffinity has a domain mode (which can be triggered by the affinity_use_domain configuration option) which returns a fixed backend for every client based on the requested domain. If the backend no longer exists (such as if, for instance, you removed it live from the pool), it will return a different backend - so you can still play with Perlbal live and it will not hurt the SessionAffinity module.

My client seems to have improved cache performance using this feature so far.

If you're using Perlbal::Plugin::SessionAffinity and find it useful, drop me a line. If you're using this feature, I'd be happy to get any feedback.

Perl 5 Porters Weekly: October 7-October 13, 2012

Welcome to Perl 5 Porters Weekly, a summary of the email traffic of the perl5-porters email list. Sorry this week's summary was delayed, I just ran out of tuits this past weekend. Let's get right to the topics this week:

  • Perl 5.14.3 is now available
  • maint-5.12, maint-5.14, and CVE-2012-5195
  • perl 5.16.2 cometh
  • Stupid COW benchmarks
  • aasign'ing hash with odd number of elements and duplicates
  • Compile option to disable taint mode: speedup
  • Making PerlIOStdio_invalidate_fileno() less invasive on FreeBSD

Tapper release 4.1 "Cagney & Lacey"

Lacey: Looks like a young Omar Sharif.
Cagney: He's got crooked teeth.
Lacey: You know, Christine, you're very critical. That's your trouble with men. You want them all to be perfect.
Cagney: No, I just have a thing about teeth.

-- Cagney & Lacey, "Let Them Eat Pretzels" (1983)

Tapper release 4.1 codename "Cagney & Lacey"

We just finished a new release of "Tapper", our all-embracing test infrastructure, used for Linux and virtualization testing in the OSRC and the infrastructure behind Perl::Formance.

Changelog for this release:

Databases

  • refactoring to also work with PostgreSQL

Automation

  • scheduler 10x speedup
  • host blacklisting per queue
  • beginning Cobbler support

Tools

  • CLI command harmonization

Documentation

  • migrated to POD for maintainability
  • complex precondition and testplan examples

Misc

  • overall cleanup to sync with upstream technologies
    • autotest 0.14.x
    • Perl 5.16
    • Catalyst 5.9

Credits

Kudos as usual to the CPANTESTERS infrastructure which allows us to test over a wide variety of platforms.

Kind regards,
renormalist

Is there a list of CERT advisories keyed to fixed Perl versions?

Is there a list of CERT advisories for Perl and the corresponding version in which p5p fixed them? I know that they have responded to almost all of the serious advisories with the patched versions for even the "unmaintained" versions.

I was wondering about that last week as I was reviewing a code base that runs on v5.8, a common situation for companies with big Perl applications that have been around for awhile. I'd like to have some chart that shows which vulnerabilities you have based on your Perl version.

I figure someone might have this somewhere, so I haven't done the work to make the list myself.

Curiously, I found that CERT has Perl programming standards. Now I'd like a Perl::Critic plugin that checks all the CERT things. I think that would be a good candidate for a TPF grant, actually.

Who's invented the day extender so I can get twice the time each day to do all the things I want? :)

Map of CPAN - The Movie

poster.pngIf you've visited the Map of CPAN more than once, you'll notice that it has changed quite significantly over time. Coloured namespace areas expand as new distributions are uploaded and this expansion pushes other namespaces around - producing a kind of continental drift.

I thought it might be interesting to assemble a stop-motion animation of these changes. The result is: Map of CPAN ? The Movie.

As with the static map, the colours don't really have any meaning beyond grouping together modules that share a namespace. The colours have even less meaning in the animation since I've used a static namespace-to-colour mapping which doesn't change as the areas move.

If you look closely you'll see little dark blue squares flashing by. Each flash represents the upload of a new distribution (i.e.: not a new release of an existing distribution).

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.