Stop Writing Your Own Commify Functions

Writing your own commify function may well be right up there with writing your own web framework or templating system. Most of us have done it and it probably wasn't worth the effort. Enter CLDR::Number. (I should note here that it's not obvious from the name that this module will commify for you -- that's one of the reasons I'm writing this up.)

Read the full post: http://www.olafalders.com/2015/09/04/stop-writing-your-own-commify-functions/

Anonymous Classes With Private Data

A long while back (I’ll find the reference if I can) Stevan Little, author of Moose, commented that part of what he wanted for a p5mop was the ability to have truly private data in classes. Much in the way Perl 6 has $!data attributes that are simply private data, he wanted to just be able to use Perl’s regular variables in this same way.

I took this as a bit of a challenge and several iterations later, I had a working system. I then spent months trying to decide if I wanted to put it on CPAN. I kept weighing utility vs practicality. Though it is an interesting thought exercise, I have no idea if its a good idea.

Calculating U.S Federal holidays with Time::Moment


Time::Moment 0.27 introduces the concept of $tm->with($adjuster). The adjuster is a CODE reference which is invoked with an instance of Time::Moment and is expected to return the same.

Time::Moment comes with Time::Moment::Adjusters which currently only provides routines for navigating/finding the day of week.

The following is also available on CPAN, as us_federal_holidays.pl or on github.

Changes, nags and git hooks

I use Dist::Zilla with a few plugins, including NextRelease and Git::Check. I was always nagged by the fact that committing actually left the Changes file uncommitted... until now. Read it here.

Perl::ToPerl6 v0.40 released to CPAN last night

Highlights include:

ModuleSpecific::Exporter - Reads @EXPORT and @EXPORT_OK to add 'is export' attributes to your subroutines
ModuleSpecific::Moose - Adds Perl6 style attributes to your Moose class based on C.

Quieting the application - use '--detail 5' to see what's been done
Bug fixes to refactoring - The current binary handled 32000+ files including perl5 core and several gnarly Matt's Script Archive escapees

P6SGI: Revising and Reviewing

After my previous post I received quite a bit of really good, constructive feedback. Thank you all who responded to my request for comments! I would say the gist of the feedback was this:

  • Make the interface simpler for middleware and to a lesser extent, servers.
  • Consider always requiring the Promise interface.
  • Consider using Supply instead of Channel as it is non-blocking and likely to perform better.

After wrangling and playing around with various things and learning more about Perl 6 than I knew before, I have come up with what I think will be a stable interface that satisfies all of these suggestions.

First, since Promises are easy to do, I agree, let's just always require them. This means that the basic Hello World app now looks like this:

Fast handy languages

My new blog post is a summary of what the Marpa parser is about. It even includes a section on when not to use Marpa.

eager, hyper and race

a real usable Perl6 is imminent. So this weekend, I decide to play it around (the last action is 10 years ago). After one day playing, I feel it has evolved greatly! it's already a much fantastic language than perl5 even than I image it. of . It's cleaner, more logical, more consistent and built-in some important feature which perl5 hasn't.

Implicit parallel is one of the features I eager to have. In perl6, you can use 3 key words to speed up list operate(in parallel way):

eager: force non-lazy list processing

hyper: requests (but does not require) parallel evaluation. In any case, it declares that you don't care about the evaluation order, only the result order. (means it would block when one thread is not ready I think)

race: forces parallel evaluation of any iterator, hyper, or junction, such that if any single thread dies or hangs its computation, it does not block any other thread from returning its results to the race list.

It looks fantastic! doesn't it?
Sadly, when I tried:
my @c = 1..10;
eager @c.map: {say $_};
hyper @c.map: {say $_};
race @c.map: {say $_};
it throws some errors
and seems not implemented yet. or maybe I made some mistakes? anyway, I want use it in 2016! ;)

Perl::ToPerl6 release tonight with Test::More, Exporter and Moose helpers

Along with:
Quieting the application - use '--detail 5' to see what's been done
New refactoring tools in Utils::PPI
Unused options trimmed out
Bug fixes to refactoring - The current binary handled 32000+ files including perl5 core and several gnarly Matt's Script Archive escapees

ModuleSpecific::Exporter - Reads @EXPORT and @EXPORT_OK to add 'is export' attributes to your subroutines
ModuleSpecific::Test-More - Changes 'Test::More' to 'Test', moves 'tests => 42' out into a proper function call, and properly hyphenates Test-specific function names.
ModuleSpecific::Moose - Adds Perl6 style attributes to your Moose class based on C.

Reminder on Call for Papers for Perl Dancer Conference in Vienna

The submission deadline ends August 31th, midnight CET.

Please use the online form for submitting your talk or write to 2015@perl.dance if you need help or more time to prepare your proposal.

We already confirmed a number of interesting talks and there are a few more prominent speakers like Peter Rabbitson and Russell Jenkins which are going to present at the Perl Dancer Conference.

Twelve years ago, Perl 6

In Software Exorcism (published in 2003), there is a mention of Perl 6:

    The JVM is not the only virtual machine on the market. The Parrot virtual machine, for example, executes bytecode compiled from Perl 6.

SWP Day Two

Well a little less busy today just a few talks and mine own and then a little Perl6 playtime.

Maxim Vuets (‎mvuets‎) gave an interesting talk on that terrible Canadian invention of toki pona. Some-how Max managed to get Perl to work at parsing that language and it gives a whole new meaning to the Practical part of the P in Perl.

Next Dave and I where up with our introduction to Replay which was well received and we had a few good suggestions for some other programmers.

Mike Francis (‎mrf‎) was up again and today with a much expanded talk on Web::Machine and Dave and I got a few ideas on the restful part of Replay

I took a bit of a much needed Nap for most of the rest of the day but I did take a litle time to see how the Perl6ers where doing and they started with over 300+ failing test files and Gog knows how many failed test, insert dumb look from Stefan here,to just about 20 test files and 100 tests.

We ending the days with a few lightning talks, just remember that 6 in German sounds funny to an English speaker, a good dinner and then a clean up and I am off to the Mountains to bag those last few 4ks .

MongoDB monitoring with swat

MongoDB provides some http interface to enable monitoring.

Swat is a perl/bash DSL for web application smoke tests. The one of interesting feature of swat is that one could easy create a smoke tests suite for a certain application and then distribute it as cpan module.

Imaging you an IT guy. So add monitoring for mongo now is as simple as installing cpan module :


$ sudo cpan install swat::mongodb
$ swat swat::mongodb 127.0.0.1:28017
/home/vagrant/.swat/reports/127.0.0.1:28017/listDatabases/00.t .. ok
/home/vagrant/.swat/reports/127.0.0.1:28017/serverStatus/00.t ... ok
/home/vagrant/.swat/reports/127.0.0.1:28017/buildInfo/00.t ...... ok
All tests successful.
Files=3, Tests=12,  0 wallclock secs ( 0.02 usr  0.00 sys +  0.03 cusr  0.00 csys =  0.05 CPU)
Result: PASS


A Video-to-Song Converter in Perl 6

Here's my longest Perl 6 script yet. I'm trying to come up with some shorter ideas for future articles.

I have a directory full of music videos in MP4 format, and wanted to convert the audio to MP3 files. I also wanted to insert the title and artist, which are generally found in the filenames, into the ID3 fields in the MP3 file. However, there was a sticking point: the filenames are inconsistent. The only pattern is that they all end in 12 junk characters and a ".mp4" extension. Other than that, some are "title - artist", some are "artist - title", some are one of those without the hyphen or anything to separate the two, some have other bits of text stuck in here and there, a few don't have the artist at all, and so on.

Help me test Net::SSH2

Short story

I have released a new development version of Net::SSH2.

Help me test it, please!

Really long story

Some years ago, I started working on Net::OpenSSH. At the beginning it was just a hack, but it worked unexpectedly well and I was able to push a very perlish interface on top of it and over time it grew and become a very powerful and feature rich module and above all, very user friendly.

Just one drawback remained. Due to a limitation in OpenSSH the module, it couldn't be made to work on Windows (well, maybe now, that Microsoft is pushing OpenSSH development there...) and that bothered me. Windows users were limited to two choices: the almost impossible to install, unmaintained and buggy Net::SSH::Perl or the at that time new Net::SSH2, a wrapper around libssh2 that was quite promising but still very low level and quite hard to use.

SWP Day One

Well after being all Perl6ed out the day before I was up bright eyed and bushy tailed for this year's Swiss Perl Work Shop

The first talk today was by Dr. Tara Andrews (‎aurum‎) a most entertaining speaker who can some-how mix arcane Byzantine~Armenian history, the battle between the Epistemology of the Inexact and Exact Sciences, digital rot and open source Perl projects and still keep a room full of programmers spellbound.

We where next treated to what I could only call a fireside-chat with Larry Wall. We head a great deal about the evolution of Perl6 and how it has gone though many incarnations over the years to the point (you heard it here first folks) that Perl6 might not be ready for his birthday but will be ready before Christmas.

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:

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!

My First Perl6 (Part the First)

Well since I was in Olten anyway for the SWP I might as well take in the Perl6 workshop. I initialy signed up to do some install testing on windows 64 which according to the many rumors I have herd it would be a nightmare wrapped up in a nice bow.

So after arriving a little later than expected and seeing the good old familiar faces I grabbed a seat and began to play.

The first stop was getting started page on Perl6.org and within a few mins of poking about I found the Rakudo page followed the link there to the MSI page clicked the button and bingo-bango-bongo of and ready with Perl6.

Well so much for Perl6 being hard to install.

Well next I tackled a few simple scripts the normal 'hello world' type scripts and a few other ones and of course this gets very boring very quickly unless your idea of a good time is trying our regex but that is more like my nightmare.

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.