Split a .pm into a .pod and a .pm

I searched on CPAN but was unable to find a way to split a .pm into a .pod and a .pm, so I made this script:

https://www.lemoda.net/perl/split-pod-from-pm/index.html

It's proved quite handy so far. Recently I took over maintenance of an old module called Net::IPv6Addr as part of the CPAN day. Today I upgraded the documentation a little so that the synopsis example is machine readable:

https://metacpan.org/source/BKB/Net-IPv6Addr-0.7/examples/synopsis.pl

https://metacpan.org/pod/Net::IPv6Addr#SYNOPSIS

Since most people probably don't read the documentation beyond the synopsis, I think it's important to make sure that the code example in the synopsis actually works. There are quite a few modules on CPAN where the synopsis code doesn't work. In the case of Net::IPv6Addr, I even have a test that the synopsis example works:

https://github.com/benkasminbullock/net-ipv6addr/blob/master/t/synopsis.t
https://metacpan.org/source/BKB/Net-IPv6Addr-0.7/t/synopsis.t

A Mature Mosoe

Its another quick test postette today in the Moose-Pne

So things are moving along now I just just going to finish off '57_dad_elements.t so it will be a short one today. Nothing much to Add I just have to add in dynamic link, gather, and sort.

Well sort should by the most easy one so I will do that one first; All I did was copy out the last (5th) item in the main hash and added it in like this;

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.

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.

Big Moose Almost Ready

Its back to view day here in the Moose-Pen

Today I am going to carry on with getting full coverage for test case '57_dad_elements.t' and fixing the bug I found in yesterays post.

First the bug. I am missing the view in the last left of this nested element;

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

Big Moose All in a Row

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;

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!

Big Moosse Catches up

Its condiment day here in the Moose-Pen

Now it is time to play catch-up with my Database::Accessor and make the same changes for 'links' that I did for 'conditions'.

First off I could create a new Role as both share the same basic attribute again but I think I will not do that and instead do this;

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.

Moose Growing Pains

Its test round up day here in the Moose-Pen

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.

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!

Take a walk on the C side, ddt, du du, du du ...

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.

The documentation for NativeCall is here https://docs.perl6.org/language/nativecall#Getting_Started

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.