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.

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.

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).

Using MooseX::Types to inflate config values

For a large application, configuration files become a necessity. They help flexible code be used in multiple instances across multiple modules. But they are, for the most part, only data structures, which can be a problem if the configured object is expecting another configured object.

package FakeRepository;

use Moose;
use TimeSeries;
has timeseries => (
    is => 'rw',
    isa => 'TimeSeries',
    required => 1,
);

package TimeSeries;

use Moose;
has dates => (
    is => 'rw',
    isa => 'HashRef[Number]', # Date => Value pairs
    default => sub { {} },
);

Here we have a FakeRepository that requires a TimeSeries object. Certainly, this is where a Dependency Injection framework could step in and inject the required TimeSeries. The drawback is the indirection: The two configured objects are completely separate, joined only by the reference, like so:

# dependency.yml
- service:
    name: 'test_repo'
    class: 'FakeRepository'
    constructor_args:
        timeseries: { ref: test_data }

- service:
    name: 'test_data'
    class: 'TimeSeries'
    constructor_args:
        dates:
            2012-01-01: 1.56
            2012-01-02: 1.69
            2012-01-03: 1.45

YAPC::Europe 2013 in Kiev, week minus 43. Hotels

Last week we talked about air tickets, thus let's talk about hotels now.

Basically, there are lots of hotels in Kiev with a wide price range. It's worth to spend some time to find the most appropriate variant for your needs. There are hotels and hostels in Kiev, or you may rent an apartment.

Our previous events in Kiev show that it's safe and reliable to rent a flat in Kiev, although you should know that before the EURO-2012 there appeared a number of fake or unreasonably expensive places. We hope it is now completely gone, but please be sure to double check if you are going to rent a flat with no reviews, contacts etc. As there are no more global EURO football events in Kiev in 2013, you may expect affordable prices for the hotels of all types.

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