Script to update some modules

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.

Promises promises ...

Problems with concurrency, a post from the hard reality.

This worries me a bit I must admit; a few years ago, before the official release of P6, I tried my hand at concurrent programming in rakudo and it was so broken that i simply shelved P6 for over a year, it was simply not ready for a lambda dev like me. I would have loved to be in the trenches but I did not have the time to fight with core dumps.

As the speed of P6 is not stellar, I believe many of us, lambdas, will try to run things in parallel, it's also fun, to make them more attractive. The concurrency mechanism in P6 look good on paper, good enough so I can find myself dreaming of throwing in a few keywords in places I think concurrency would make a difference.

There is a nice silver lining to this one, It took a very short time before a lead developer answered me. I believe his answers may be interesting to read.

A description of the problems I encountered is here: gist

Perl in Japan

We recently did an interview with Daisuke Maki on the Perl community in Japan.

This is what came out of it - http://blog.builtinperl.com/post/perl-in-japan.

Have a look/read.

Perl 5 Porters Mailing List Summary: August 15th-21st

Hey everyone,

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

Enjoy!

Trying out AWK in Java with Perlito5

I’ve got this example “awk” script:

$ cat x.awk 
BEGIN { print "Month Crates"
    print "----- ------" }
    { print $1, " ", $2 }

we can convert AWK to Perl with “a2p”:

$ a2p x.awk > x.pl

now create a test input file:

$ cat > x.txt
a b
d e
1 2

and try it out in Perl5-Java:

$ java -jar perlito5.jar x.pl x.txt 
Month Crates
----- ------
a     b
d     e
1     2

yay!

How the RPi::WiringPi distribution is tested

So I'm gearing up to write a "Howto Raspberry Pi with Perl" multi-chapter tutorial, and as I finalize a few last things, I thought I'd put together how all of the software is laid out and is continuously tested.

The RPi::WiringPi distribution is essentially a class that provides access to external sub distributions, and provides several benefits such as maintaining a registry of in-use GPIO pins, and ensuring your Pi is cleaned up back to default on exit, or if an error or signal is caught. The sub modules do none of those things.

I use the automation and dispatching capabilities of my Test::BrewBuild software to handle the test management. This software runs your unit tests on any/all Perlbrew and/or Berrybrew installed instances, with the ability to dispatch your test requests over the network to remote machines. I'm not getting into those details, just know I use the bbtester binary to listen for test requests, and the bbdispatch binary to send them, both on the same Raspberry Pi hardware.

Plan for perldoc 4.0

At TPC in Amsterdam I gave 2 lightning talks under the title perldoc -O. It was a questionary for the attendance which should give me some orientation which feature to prioritize or how to modify them best. I also spoke and mailed with all people I deemed relevant and want now to lay out the feature set I want to achieve with the rewrite.

SPVM progress in 2017/08/17(SPVM have static typing and fast and easy to call function)

SPVM project is improved day by day. SPVM is the project which provide static type data structure to Perl, and improve the performance of numeric and array operation.

I start to write SPVM specification. Most of all are Perl syntax.

Latest change is the following.

Lets celebrate CPAN day in a special way

Finally the day arrived, I have been waiting for, since the reminder blog by Neil Bowers. It is like double celebration for me, as we celebrated 70th year of independence, yesterday i.e. 15th Aug.

I was working on couple of ideas to make it special CPAN day. One of them was to create map for Kolkatta Metro. Since it is special occasion for all Indians, I thought why not release something related to India. Kolkatta Metro is the first metro ever started in India.

So Map::Tube::Kolkatta finally made it to CPAN with love. This is not the only thing I have planned for today. I am going to submit at least one pull request as well. If it gets merged same day then it is going to be icing on the cake.

The 20th Anniversary Perl mongers Shirt

20 years ago this week, we invented Perl mongers. I've revived the original Perl mongers t-shirt for the occasion, with a tweak to denote the years. It's available only through the Kickstarter and I won't produce it again.

When the moon blocks out the sun in the upcoming sign of the universe, the Kickstarter will end. I don't think the two are related. We certainly didn't plan for the 20th anniversary to coincide with totality.

Beginners and Conferences

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.

User group topic: Script Spotlight

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.png

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:

  • your $HOME/bin directory
  • /usr/local/bin
  • your cgi-bin directory
  • scripts called from cron jobs
  • scripts called from your editor
  • scripts attached to a hot key
  • Nagios checks

See you there - with your script :-)

Use STRLEN not int for SvPV

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:

https://www.lemoda.net/perl/perl-xs-cpan-testers/index.html

Despite having known about this for years, I just found another instance in my own module, thanks to the warning messages from clang, in Text::Fuzzy:

https://metacpan.org/source/BKB/Text-Fuzzy-0.26/Fuzzy.xs#L51

I've just now updated it:

https://metacpan.org/source/BKB/Text-Fuzzy-0.27/Fuzzy.xs#L51

Perhaps it would be worth making some kind of automated checker to go through XS code and make sure the second argument to strlen is always STRLEN.

The emperor's new clothes

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.

My Perl Conference in Amsterdam Takeaway

Inspired by domm, I'm posting my takeaway of the Perl Conference in Amsterdam (which I wanted to present in-house anyway):

Perl 5 Porters Mailing List Summary: August 7th-14th

Hey everyone,

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

Enjoy!

Swiss Perl Workshop Pre Conf Meetup + More News For Attendees

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 are coming from Germany please double check your train route as there are some issues with the tracks: https://www.tagesanzeiger.ch/panorama/vermischtes/reisende-steigen-nach-gleisvorfall-auf-flixbus-um/story/26874354

If you haven't yet signed up for the workshop, and are interested then there's still time: SPW 2017.

As always, many thanks to our sponsors:


Reading a binary file and printing it's contents as hex values

Seems like a trivial task - and it is.
But to get to the point on how to actually achive this with not that much code took myself around two hours.

Ask not what CPAN can do for you

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.

Perl 5 Porters Mailing List Summary: July 31st - August 6th

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.