A couple weeks ago we had our first meeting for the Perl Adventure Series. Despite a terrible ice storm we still had 3 new people turn out in addition to our regular cast of characters. I hope we see them (and more) back.
During the meetup we set up our Dist::Zilla config file, and a new GitHub repository for the adventure series. And we got started designing the mission data structure.
We had a great time discussing all the implications of this design. There was a heated argument about including code snippets inside the config file in order to keep the game engine generic. However, I’m going to argue to the group that we should be putting these code snippets out into individual modules (or perhaps roles) and then just name those plugins in the config file. I hate the idea of code in a config file. It makes my skin crawl.
So we all know
the COMPSCI 101 method of swapping two variables: $tmp = $x; $x =
$y; $y = $tmp;
And we all know the better way of doing it: ($x, $y) = ($y,
$x);
And yet, I
found the following in PRODUCTION CODE, that a contractor was PAID ACTUAL DOLLARS TO WRITE: ($tmp_x, $tmp_y)
= ($x, $y);
($x, $y) = ($tmp_y, $tmp_x); Weird that
they knew about parallel assignment but not that you could just apply it to two
variables directly.
Anyhow, this
wasn’t nearly as bad as the code I found in a different module (same vendor) to
swap all the 1s and 0s in a string. Now this is a somewhat less trivial
problem than simply swapping two variables, but $str
=~ tr/01/10/;
does the job nicely. Alas, in the same vein as the variable-swap, the method
that vendor went with was:
$str =~ s/0/2/g;
$str =~ s/1/3/g;
$str =~ s/2/1/g;
$str =~ s/3/0/g;
Here is my latest post about Sparrowdo configuration management tool written in Perl6 -
Sparrow plugins vs ansible modules - an attempt of informal comparison of sparrow and ansible eco systems.
I've been rather quiet lately because between building Tau Station and working with some clients, I'm running around faster than a long-tailed cat in a room full of rocking chairs.
I'll be in Brussels for the February 4/5 2017, FOSDEM, talking about Building the Tau Station Universe in Perl. I was planning on giving a talk about testing, but I was specifically asked if I'd talk about Tau Station. While I love the project, I tried to think of a way it wouldn't sound like a 40 minute infomercial at an open source conference.
Relaxing in a high-tech hotel room in a space station.
I recently
ran across an article (http://neilb.org/2016/08/08/quoted-words-arrayref.html)
by neilb, advocating for a qa() operator that
returns an arrayref instead of a plain array: our
$cars_ref = qa(sedan hatchback coupe);
I love this idea, and I would use it a lot.
I’d like to
add onto this proposal another qw()-style
operator to quote the keys of a membership hash. I suggest qk() for “quote keys.” So our
%is_color = qk(red
blue green);
is the same as our
%is_color = map { $_ => 1 } qw(red blue green);
or our
@colors = qw(red blue green); our
%is_color = map { $_ => 1 } @colors;
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.