Entering MooseX, XIX Now We Package II

So in my last post I had started to play about with Dist::Zilla and my initial playing about I was very pleased at what it gave me. Now I did have a few thinks to clean up, some test roles that where throwing some sort of warning when they should not and where I was building the Mod was 100% right.

So the first the extra roles


Warning: prerequisite test_role1 0 not found.
Warning: prerequisite test_role2 0 not found.
Warning: prerequisite test_role3 0 not found.


So having a look at 'Dist::Zilla::Plugin::AutoPrereqs' I see there is a 'skip' attribute for it (with with Dist::Zilla plugins there are custom param you can pass to them from the .ini file.

So all I need is add a quick regex like this to the ini file

[AutoPrereqs]
skip = test_role\d

and then did

dzil build

Spelunking: why 'while(){ }' is my new favorite perl-ism

Today I saw a post by sartak mentioning a feature I didn't know: while () { ... } is legal and acts as an infinite loop.. This is awesome! I occasionally have need for a while(true) loop, and I like while() better than while(1).

But I couldn't stop there, I had to find out why, and if it's a feature I can count on.

(If you think you'll go cross-eyed looking at parsing details, please still check out the commit message I found at the end, it's a neat bit of history).

Checking the docs

On Giving Back

A few days ago I published Math::Vector::Real::Farthest, my 100th CPAN module. I got into CPAN in 1999 so it has been a long, mostly quiet, way.

Some modules were a side effect of my paid work, done while contracting or, lately, as a regular employee. But most of them were done on my free time for fun. Just because I had that idea on my head, or because somebody just pushed an interesting problem under my nose (AI::Termites, Algorithm::ClusterPoints, Algorithm::GaussianElimination::GF2), or because I felt I could do something better (Net::OpenSSH, Net::SFTP::Foreign, Sort::Key), or because I needed something to waste my time (Language::Prolog::Yaswi) or because I felt that somebody just have to do it (Math::Int64, Math::Vector::Real, Tie::Array::Packed) or well, whatever.

As such, I never asked to get anything back. Fun was pretty good and enough.

Gittip and companies?

On the main page of Gittip 6 out of the 12 top givers are companies supporting open source. On the main Perl community Page there is no company, and on the extended version of the Perl community Gittip page there is only a single company: Nestoria (currently at position 33-37, giving $1) out of the 42 givers.

I wonder when will companies relying on Perl, come to the conclusion that this is a good and very cheap(!) way to show their support to the Perl community, and probably make it easier for them to hire good developers.

Maybe managers in your company need to be made aware of Gittip and the Perl community there.

Entering MooseX, XVIII Now We Package

Well starting today to look at Dist::Zilla and as I develop mostly on a Winders box (yes I know I a not a real Perl programmer) I had a look at the Testing Matrix to make sure I can use it and I can. So step two was a doing the install and it does have quite the dependency list and my Perl is quite sparse in terms of installations so it took a good half-hour to install all the needed modules and this is my new super fast 64k super gaming lap top so I would think it is a little slow but it does go in

Now looking at the POD it is very well documented and and it even has its own web site which is quite well laid out and easy toe use.

Nestoria's Module of the Month

Now this is an idea that I wish more companies would get behind.

Nestoria is a property search engine based in London, but covering several countries (I use them here in France). They're really slick, growing nicely, and their back end is mostly written in Perl. A couple of day's ago they wrote on their blog that Test::More is their module of the month.

Why is this cool? Because this is going to be a regular feature and they're going to start donating a $1 a week (via gittip) to the author or a prime contributor of whatever project they've selected. I would love to see companies financially backing open source products they benefit from. I see plenty of companies are signing up for gittip for this very purpose.

To Nestoria: many kudos for finding yet another way to give back (they also sponsor Perl events and release open source code).

To everyone else: go sign up for your gittip account if you haven't already.

And ask your company to think about gittip and maybe giving back to those who've helped them. I suspect many companies wouldn't find $1 a week to be a burden, though they can certainly pay more if they wish.

I like you just the way you are.

Perl, I like you just the way you are. There's been some interesting features and fancy OO modules in the last ten years, but my code is still 5.6.0...

Prototypes and the call checker

Perl prototypes are fascinating. They enable: making argument count enforceable at compile time; adding an implicit argument; changing how a list of arguments are parsed; changing how individual arguments are parsed; and even allowing Perl to optimize away a call to that function. Unfortunately, it's also impossible to count on any of these things; those changes only take effect if the sub can be reliably looked up when the call to it is being compiled, and since calling a sub with a & specifically prevents doing that look up in the first place.

Entering MooseX, Part the Seventeenth

Hey guess what no tests today and really not much of a blog either.

I and now moving into actually creating a distribution for this little mod of mine now that I have all the code written and all the tests done, though I really should do the POD next I am going to step out of order a little and look at different ways to create a distrabution

Well the reason why I am doing this is that I have only ever done it the craftsman way. Or in other words by hand and hope for the best.

So I have been shopping about looking for something that will help me out. Well went to META::CPAN and just entered 'dist' in the search box and hit enter. Well got over 1000 hits. So this is a subject that has a good deal of potential or perhaps it just something that every programmer likes to do her own way.

Automatic variable highlighting in vim: the easy way

Three days ago, Ovid was nice enough to write about variable highlighting in vim. When I tried that vim script myself, I soon ran into the bug that was also found by Robin: If the cursor is above a hash, the actual use of the hash won't be matched.

So I took a look at the vimscript code and ... found that it's way too much code for my taste.

Math::Prime::Util, May update

Math::Prime::Util 0.41 was released, with new functions (valuation, invmod, vecsum, binomial, forpart), and the usual crop of performance improvements. In particular, primality testing on x86_64 got another big speedup.

On prototyping in public ... the long version

I recently posted a quick update on the p5-mop project the other day, something I have been meaning to do for a long time. I am sure given the slow and often rocky progress of this project that many people have their doubts if will ever see the light of day, and to be quite honest, some days I found myself doubting it as well.

Entering MooseX, Part the Sixteenth

Well I really mean it this is I think the last last .t for this module. This time I will be testing the use of my new module as a trait. So here goes

I start with the usual suspects

Automatic variable highlighting in vim

After viewing an interesting post in Reddit about programming in color (syntax highlighting that focuses on data flow instead of syntax), I saw that one user had developed a very similar feature for PHP. The idea is to highlight the variable that your cursor is currently on. I liked what he wrote, so I modified it for Perl.

Transparently testing Catalyst applications for memory leaks

Summary: you can use CatalystX::LeakChecker to check every request in your test suite for memory leaks.

From my blog, here.

DOIs for Perl Module tarballs, probably

A while back, Mark Fisher wrote about DOIs. As an academic, I asked about how I might cite a DOI for some Perl work. I was recently made aware of two possibilities.

And Now for Something Not Moose Releated

Well been eating way too much over the past posts so I though i would go though today's little upset for a change in pace.

Well today I was going back in time a little and had to write up a little script that would get the latest file on a dir and count the number of lines in it (don't ask why) and the do a little more processing.

Well it seemed simple enough and I have done similar before but for kicks I decided to do a Google search for 'Get the latest file with Perl'

Well my eye got sore after reading the endless variations on the same theme, from 30 line monstrosities to one line wonders that would befuddle even Peteris Krumins?

Well then I harkened back to something that Lary said in his YAPC::EU 2010 Keynote talk, that Perl was denounced in the Unix world because it does everything but doesn't do it well.

m_img_12879.jpg

One package perl pm file

Recently one of our readers checked if Tie::ExtraHash was installed on his system running perl 5.18.0.
He used perl -MTie::ExtraHash -e1 but it said the module was not installed. So he wanted to install it from CPAN, which then offered to upgrade perl to perl-5.18.2.

It turns out Tie::ExtraHash is declared in the pm file of Tie::Hash and you should not use it on its own.

That set aside, wouldn't it be better if all the packages, at least in the Perl core, had their
own pm file with their own version number?

It certainly has some advantages.

BTW If you'd like to make sure in your code every package has its own pm file,
you can use the Perl::Critic policy Prohibit Multiple Packages in the same .pm file. It could be used to improved your code one policy at a time.

Fun with binomials

I decided to add a binomial(n,k) function to Math::Prime::Util, and found some interesting things while doing it. Overflow detection and mitigation in C and Perl were the first thing. Next was looking at negative arguments, which led to finding some differences in various solutions as well as filing a bug report for Math::BigInt.

Nestoria Developer Blog

Following in the footsteps of Booking.com, NET-A-PORTER and All Around The World I am happy to announce that Nestoria is launching a developer blog as a sister site to our more general company blog.

You can find it here: http://devblog.nestoria.com.

Bookmark it, Feedly it, follow it on Tumblr - whatever the kids are doing these days.

As you can see we've already made four posts since we launched on Tuesday, 2 days ago. We don't intend to keep up that kind of pace, but we do intend to post at least once a week on various topics that interest us and we hope will interest you. If you're interested in Perl, Linux, web servers, database servers, JavaScript, testing, mobile web, software development, virtual servers, physical servers, and/or system administration then you should find something interesting in the blog sometime in the coming months :-)

If you want an overview of Nestoria I've actually given quite a bit of information away in an interview I did with Ovid right here on blogs.perl.org: Perl Startups: Lokku/Nestoria.

As a sneak peak one of our next posts on the Nestoria Dev Blog looks like this:

Of course I couldn't give away the winner here - you'll have to read the blog to find out who wins this month's Gittip donation :-)

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.