The Perl Foundation Grant Committee is looking for new members

If you're looking for ways to be more involved and have more influence, here's your chance!

The Perl Foundation's Grant Committee is looking for new members to the Committee Member position and the Committee Secretary position.

You can find more information on TPF blog.

Saying of the day...

When your hammer is Perl, every other language looks like a nail!

Dancer2 0.204003 fixes missing dependencies, improves error handling

Dancer2 0.204003 is on its way to CPAN now, and provides the following changes:

  • The CPANTS testing service reported that some dependencies for Dancer2 were not specified in the distribution. This has been corrected, and we apologize for any issues this may have caused.
  • When a route exception occurred, Dancer2 would catch the error first, and would prevent any custom exception handling from trapping the exception. There were some ugly hacks for working around this, but this fix puts things right, and lets the exception hook fire first, and then will trap the error.
  • Several changes were made to Dancer2’s Template Toolkit integration, the most significant of which being the removal of the ANYCASE option.
  • Various documentation improvements.

A big thank you to those who contributed to this release and helped get it out the door.

The full changelog is as follows:

Bit string manipulation made easy with Bit::Manip

I've been writing a lot of software lately that deals with direct hardware access (specifically analog and digital hardware for the Raspberry Pi). This means that I've had to learn some C, as well as get proficient with bit manipulation and the bitwise operators.

As part of my learning, I thought I'd write a module to do this bit manipulation for me, hence Bit::Manip was born. (There's also a Bit::Manip::PP for those who can't/don't want to use XS. It should be indexed shortly).

Here's a scenario based example of how the software can be used.

You have a 16-bit configuration register for a piece of hardware that you want to configure and send in. Here's the bit configuration

|<--------- 16-bit config register ---------->|
|                             |               |
|---------------------------------------------|
|                             |               |
|                             |               |
|<------Byte 1: Control------>|<-Byte0: Data->|
|                             |               |
|-----------------------------|---------------|
| 15 | 14 13 | 12 11 | 10 9 8 | 7 6 5 4 3 2 1 |
  __   _____   _____   ______   _____________
  ^      ^       ^        ^          ^
  |      |       |        |          |
START    |       |      UNUSED      DATA
      CHANNEL    |
              PIN SELECT

...and the bit configuration:

Perl Aventure Series Part 2

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. 

Strawberry Perl 5.24.1.1 + 5.22.3.1 released

Strawberry Perl 5.24.1.1 and 5.22.3.1 are available at http://strawberryperl.com

More details in Release Notes:
http://strawberryperl.com/release-notes/5.24.1.1-64bit.html
http://strawberryperl.com/release-notes/5.24.1.1-32bit.html
http://strawberryperl.com/release-notes/5.22.3.1-64bit.html
http://strawberryperl.com/release-notes/5.22.3.1-32bit.html

I would like to thank our sponsor Enlightened Perl Organisation for resources provided to our project.

Swapping Things

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;

Good thing $str doesn’t contain any 2 s or 3 s!

Perl 5 Porters Mailing List Summary: January 16th-22nd

Hey everyone,

Following is the p5p (Perl 5 Porters) mailing list summary for the past week.

Enjoy!

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.