Dispatch Tables

At a previous job, I saw some code that asked the user which function they wanted to run and then executed a subroutine with that name. This code demonstrates why such a practice is bad:


use strict;
use warnings;

sub greet            { print "Hello!\n"       }
sub inquire          { print "How are you?\n" }
sub bye              { print "Farewell!\n"    }
sub delete_all_files { print "*KABOOM*\n"     }

sub insecure_call {
    no strict 'refs';
    shift->();
}

insecure_call('greet');
insecure_call('inquire');
insecure_call('bye');
insecure_call('delete_all_files');

Output:

Hello!
How are you?
Farewell!
*KABOOM*

One solution to this is the dispatch table. With a dispatch table, you define up front which calls are legal for an outsider to make:

more

Faster PDL Development Cycle---But How?

This entry is a repost from the start of a discussion on the PDL developers mailing list in the hopes of getting wider inputs from the perl community.

PDL Developers-

With the addition of two active and highly motivated PDL developers (Zakariyya Mughal and Guggle "Ed" Worth) we've made significant progress in cleaning up the PDL distribution itself and the development process itself. PDL is now run through test builds automatically on git commit via the Travis-CI framework of github. Many perl platforms and PDL configuration options are exercised. PDL-2.013 was the best tested pre-release release ever.

patch -p3

The next edition of the patch.pm Perl hackathon will be held in Lyon on Saturday September 12, 2015.

My plan for this one-day hackathon is first to take advantage of the visit of Liz and Wendy on their way home from Granada. :-) I'd also like to kick off some regular mini-hackathons (not just Perl) in the Lyon area.

So if you're in the area, join in!

Preparing for a Technical Interview (with Perl)

I've uploaded some more slides, this time from my YAPC::NA masterclass, on how to prepare for and survive a technical interview. They are somewhat Perl-related, but most of the content should be as applicable for non-Perl interviews too.

How to prepare for (and survive) a technical interview

Amazon AWS EC2 and Cluster SSH

Cluster SSH, or its OSX incarnation CsshX are great tool to quickly connect to a collection of machines and issue interactive commands in parallel. You just configure them with a collection of machines called 'clusters', set your .ssh/config correctly for all those boxes and voila, you are now in the matrix.

The problem arise when you run your stuff on Amazon's AWS on EC2 dynamic instances. It's impossible to know at a given time which instances are effectively running, and it makes your cssh (or CsshX) configuration useless.

The good news is, Amazon provides an API to access and manage EC2 instances. The even better new is there's a Perl package to access that programmatically. So..

Lets put EC2 API Access and Cluster SSH together: ec2-cssh

Read more here ..

Just announced: PPW talk deadline extended!

Calling for all talks! The Pittsburgh Perl Workshop has already received some great talks - and we're looking for a few more! Having already confirmed that Larry Wall will be attending this year's workshop to discuss the release of Perl 6 - the organizers are looking to include two tracks of great talks!

Talk submissions will continue to be accepted through Friday, August 28th. Visit pghpw.org/ppw2015 for more details and to submit your talk!

PPW will be held in downtown Pittsburgh on October 9–11 2015.

Ad-Hoc OLAP databases with Yertl and HANA

In my previous posts I showed how to set up an ODBC connection to cloud-hosted HANA (HCP) and then, in a follow-up post, I drawned on moving data over such channel on the fly using an ETL fremework called Yertl. In less then two weeks I will be giving a short talk at YAPC EU 2015 related to these topics. Specifically, I would like to share some ideas about building ad-hoc OLAP databases using the two tools (Yerlt and HANA).

Q&A Session with Larry Wall at Swiss Perl Workshop 2015

Only seven days left (and six to the start of the Perl 6 Hackathon).

Now, we need you, even in case your are not attending.

Larry Wall will answer your questions in a Q&A session on Friday at 10:50 hrs CEST.

Please ask everything you ever wanted to know about Perl and the "Perl universe" and send your questions to spw@perl-workshop.ch or add your comments to this blog post.

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.