I have some modules which I need to periodically install on a web server, and cannot use cpan or cpanm to do this. One of the problems with this is that the local copies I made of the modules sometimes get out of date with the CPAN version. The following script updates the local copies of the modules. This uses make_regex from Convert::Moji to make a matching regex for a list of modules, but you can use list2re from Data::Munge in place of that.
It the great test round up here in the Moose-Pen today
Since I have done at least two major changes in the design of Database::Accessor over the past few post I figure I better give the whole test suite the once over to see what breaks. Here are the results of the first run;
I've had many ideas for introduce Perl conference beginners into the community. Dom also had some ideas in How to make Perl conferences beginner friendly. Steal what you like, share what works!
Most notably, Domm had the idea of talk topics (or even outlines) that a beginner could claim (or be assigned). I certainly think this would help. I hate coming up with topics and love it when the organizers assign me one.
But, I've done other things too. I think the conference should be much more than talks and the spaces between talks. I'd like to see more small group activities.
Wellington Perl Mongers had their monthly meeting this week and we tried something new that worked reasonably well so I thought I'd share it here. A little bit like lightning talks but with a more specific focus. From the announcement email ...
Script Spotlight
Briefly tell us about a script you've written and use regularly. Things you might talk about:
What problem it solves - how it makes your life better
An interesting feature of the code
Ideas you have for making it better
What made it super easy (e.g.: a CPAN module, a feature of Perl, etc.)
Did you write your script in Perl - why/why not?
If you can't immediately think of a candidate script then here are some
places to look to jog your memory:
Obscure bugs occur with the following type of code:
unsigned int len;
c = SvPV (sv, len);
The bugs occur typically on a 64 bit system. They happen because unsigned int may be a 32 bit integer, but the second argument to SvPV should be STRLEN, which is unsigned long int. Giving a pointer to a 32-bit integer where it expects a 64-bit integer causes some very odd bugs, and may even crash the interpreter. So, one has to always do like this:
STRLEN len;
c = SvPV (sv, len);
and never use anything which is not STRLEN type.
I have a collection of more weird and wonderful XS bugs, found through CPAN testers, here:
I noticed that I have been working on Data::Dump::Tree for 18 months which makes me a Perl6 developer with almost 2 years of "experience", \o/. What I know is that I am going to need a few more years to get around all it has to offer. But after two years it is still fun to learn new things about Perl6.
I also noticed that 90% of my time went into DDT, the rest went into two puny modules not worth mentioning, except that 3 modules sound better than one. Development takes times, development with documentation and test, and trying to get quality and functionality takes ages, no wonder Perl6 took this long; Actually it is pretty impressive what was achieved 2 decades.
Now that my baby Moose is almost all grown up it is time to go back and look at some of the missing bits in my test suits. In my last post I fixed up the default 'view' for all the 'element' attributes that my be present on a Database::Accessor.
I have checked my test suite and I at least test the elements attribute to a few levels of recursion in '31_elements.t'. Looking at that test suit I think I will pull the eight 'view' tests out of there and and create a new test case '57_dad_elements.t' that will cover those eight and all the other 'view' tests for the DAD.
Let's meetup for food and drink at L'Alchimiste restaurant in Villars, 24.08 at 19:00. Please add this to your schedule and/or let Lee know (via twitter: @lee_a_j or IRC: Lee or e-mail the orgs) so he knows roughly how many places to reserve. See http://act.perl-workshop.ch/spw2017/event/2016.
If you're still not sure what to do on
CPAN Day this year,
you could help me with one of my trickle projects:
help us get META.yml and META.json files added to CPAN
distributions that currently have neither.
Send me an email and I'll assign you a distribution.
I've ordered the list of distributions based on how
far up the CPAN River they are.
Fixing these distributions results in more accurate river data,
and will also help various tools and services.
Over the past few days I have been slowly cleaning up my tests and now I am going to fix one more little problem I was having with Database::Accessor; Setting the 'view/table' of an element/field that is being passed down into a DAD.
I do have this working for most of the parts that I am sending down to the DAD but I am still missing this functionality on the 'sort/order by' so lets look at that test as a start;
Someone on #perl6 asked if Data::Dump::Tree (DDT) could display an int32 properly, and the adventure began.
I have programmed in C and C++ many years; from hardware related code to mangling libraries for RPC across different cpu architectures . Few years ago we had a very large testing and integration project that used Perl as the main development language; we had to write quite some XS even if we used SWIG extensively. So NativeCall is something that is really of interest even if nowadays I have little use for it, I still think it's a nice way of interfacing libraries.
Data::Dump::Tree works with types but NativeCall works with representation, types, and what I believe is dynamically create types for array (with VMArray representation), so it took some times to comprehend and get DDT to groak it.
use v5.12.0;
use warnings;
s/\A(?:[0369]|[147][0369]*(?:[147][0369]*[258][0369]*)*(?:[147][0369]*[147]|[258])|[258][0369]*(?:[258][0369]*[147][0369]*)*(?:[258][0369]*[258]|[147]))*(?:0|[147][0369]*(?:[147][0369]*[258][0369]*)*5|[258][0369]*(?:[258][0369]*[147][0369]*)*[258][0369]*5)\z/Fizzbuzz/,
s/\A(?:[0369]|[147][0369]*(?:[147][0369]*[258][0369]*)*(?:[147][0369]*[147]|[258])|[258][0369]*(?:[258][0369]*[147][0369]*)*(?:[258][0369]*[258]|[147]))+\z/Fizz/,
s/\A[0-9]*[05]\z/Buzz/,
say
for 1 .. 100
Basically it was a release that not really contained any shiny new features nor bug fixes. It was a release that addressed things we did wrong in our test cases. Tests especially matter whenever you want to install a module, so you could say that this version was just released to allow an installation of Bailador without running into errors.
So what happened?
Right after the previous release Gabor came along with a bug report saying Bailador raises an error during installation. The error itself happened in the test case 20-cli.t which can be considered as our first try to do some integration testing. Personally I think this is one of the test cases that didn't see much love, is not a pleasure to read, maybe because it is quite full of code and diags which are commented out. So let me point out a few things it does: