A little ahead but really back Moose

Its practical test day here in the Moose-pen

Yesterday I set up a new class that would generate a nice little set of DB table for me on what ever DB the end user may have by using a plug-in to supply the generation SQL. Today I greatly expanded that class but there is no real reason for me to dump it here as it is just more of the same from yesterdays post.

I did create a new class to test complete with a Data::Accesosr definition which is below;

A new wobbly wheel for GUIDeFATE

A Guide to Versions in Perl

Version numbers in Perl are very important; they allow orderly updating and maintenance of modules and distributions across the CPAN, and allow CPAN modules and consumers to require the versions of modules with the bugfixes or features they need. However, in this context, they are also a very unique beast with a complex and bumpy history that leads to some surprises for those who are not familiar with the nuances. These are the things CPAN authors should know about versions in Perl, and are nice for consumers to know as well.

To summarize:

WWW::Mechanize Best Practices

Recently at $work we were discussing some of the behaviours of WWW::Mechanize when submitting forms. For instance, when you pass the fields parameter to the submit_form() method, Mechanize might take a very lax approach to submitting your data.

I've discussed some ways to make your useragent more secure and easier to debug. The whole article is at http://www.olafalders.com/2018/04/13/wwwmechanize-best-practices/

Extend that Moose

Still extending my Moose tests here in the Moose pen today.

For my next extended tests I will need to have some tables on the target tests database. This of course poses some problems as the DDL (Data Definition Language) of each SQL db is slightly different;

Take dropping a table. You very basic SQL works fine

DROP TABLE people;
however this;

DROP TABLE IF EXISTS;
will not work on Oracle and some versions of Infomix and this is just one small example. I need to write a test suite that can handle these differing flavours of SQL and good old MooseX come to my rescue again.

StackOverflow that!

The Perl 6 IRC channel is an excellent place for all your Perl 6 needs. Any problem is solved in no time. However, it's not the best place for storing and searching those questions and answers. There's a place for that: StackOverflow.

blead Breaks CPAN a.k.a. BBC

Next week I will take part of the toolchain summit 2018 in Oslo, Norway.
This would be my second participation after last year event in Lyon, France, where I mainly focus on grep.metacpan.org prototype.

One recurring discussion during the last Perl events brought by kid51 is to improve detection of BBC - blead breaks CPAN. (note: blead is the branch tracking current perl development)

You can read more from kid51 on these topics here:
- What do we want and need for teting
- Do We Need a Tertiary Test Suite?

I think that we already have a lot of tools, matrix, smokers... in place. I've no intentions at this point to provide an extra smoking service. But I mainly struggle to get the vision I would like for these data.... It's a challenge to represent multidimensional data on a single webpage.

By gathering the data from matrix.cpantesters.org I think we could provide an easy way to see the state of the "CPAN River" across perl version

Proposed new data structure: Pile

We're all used to working with arrays to implement queues and stacks using shift, unshift, push, and pop. They allow you to keep your data nice and tidy, well-ordered and predictable.

But life isn't nice and tidy, well-ordered or predictable.

We need something in our programming language that reflects the mess of the real world.

The Pile

Enter the concept of the Pile. A pile, like a stack, allows you to add data to it, as well as retrieving it. But, rather than using the neat pop and push, you use mush and mop.

Adding data is done using the mush operator. You can mush arbitrary collections of data into a pile.

Retrieving data is done with the mop operator. When mopping data from a pile, you can specify how many items to mop (i.e. the "capacity").

Syntax

The first problem with this new data type is to find a proper sigil for piles. Since Perl supports unicode, I would suggest U+1F4A9. This would give us:

Extend Your Moose Tests

Its extended test Day here in the Moose-Pen

Now that I have what I think is 99.95% of my API set and both Database::Accessor and Driver::DBI are code-complete and passing all test cases, I think is is time to do some practical tests on my system.

By piratical I mead testing on a 'real' SQL db. So far I have been testing with the very limited 'dbi:ExampleP' DBD, and little less limited 'dbi:DBM' and only in two test cases. All the other thests cases I really just check the generated SQL so I have know idea, but a good assumption, that the code will work on a real SQL DB.

Why do you have to be afraid of the programming language Perl 6? ... or not.

*** German version below ***

In life or professional life, there are cycles of learning by starting over again or at least partially. If you are a good Perl 5 developer and you start Perl 6, you start again as a beginner. In my professional life, these cycles have never been longer than 7 years. That's why I'm not afraid of Perl 6.

Perl is being developed by community. So I do not need to worry about Perl disappearing from the market with the bankruptcy of a company at short notice. The community also has disadvantages, especially in marketing. The programming language Perl is strongly undervalued by the public.

Dancer2 0.206000_02 Trial Released

This is a quick update to yesterday's Dancer2 release to fix a couple of minor issues reported by the community. Please see the Changes file for details.

Thank you for the swift feedback! We are targeting an official release on or before April 20th.

Keep Dancing!

Programming the Raspberry Pi with Perl; eBook fundraiser (Update)

Well, thanks to all the generous donations, we've reached 71% of our initial target at exactly half-way through the campaign!!

We have decided to set a stretch goal. If we surpass our minimum $2,500 USD and get up to $4,000 USD, we will be adding three new chapters.

Timm will add one on Infrared Remote Control, and another focusing on using MQTT: a machine-to-machine (M2M)/"Internet of Things" connectivity protocol.

I will add a chapter that will step-by-step explain how to read and understand the relevant portions of a datasheet for an Integrated Circuit (IC) or some form of sensor, how to communicate/manipulate and otherwise act on the device's registers in C, the process of converting the working C code into XS, and finally creating a new Perl distribution for the device.

Thank you for all of the support!

-stevieb

Another Moose Test Day

Why break a habit day here in the Moose-Pen

Time for another bottom up test run and for Database::Accessor I had

 8 files changed, 317 insertions(+), 237 deletions(-)
and all my tests passed so maybe a very short post today? Driver::DBI was changed about the same with

 7 files changed, 1056 insertions(+), 835 deletions(-)
but this time round I got a full pass but I was plagued by warnings like these.

Use of uninitialized value in array element at /home/scolesj/database-accessor-driver-dbi/lib/Database/Accessor/Driver/DBI.pm line 803.
Use of uninitialized value in numeric ge (>=) at /home/scolesj/database-accessor-driver-dbi/lib/Database/Accessor/Driver/DBI.pm line 802.

I guess a little longer post today.

The code in question

Extracting exported variables from a module

Here is a routine from a module I made to extract the variables from a module so they can be put into Perl documentation:

Dancer2 0.206000_01 trial version released

A trial release of Dancer2 (0.206000_01) was just uploaded, and should be available on your local mirror soon. This release addresses some couple of potential security exploits, and could use some scrutiny prior to an official release.

Please see the release for the full list of changes.

There will be a coordinated Dancer/Dancer2 release in the near future with more detail. In the meanwhile, the more eyes on this, the better. Please leave us your feedback through the usual channels (IRC, email, github, etc.).

Thanks. Keep dancing!

20th German Perl Workshop - Report

First time ever attended Perl Workshop outside of London. The 20th German Perl Workshop was held in Gummersbach this year, 3rd-7th Apr.

Moose Identity Round Up. Part the Second

A little more identity clean-up here in the Moose-Pen today.

As a final clean up I would like this exception test to pass

My "Go for Perl Hackers" Cheatsheet

Last year I found myself working on some Go code at $work. When I'm trying to pick up constructs in a new language, I find it helpful to see how I would have done the same things in Perl. This sheet is far from complete, but I think it's already helpful. You can find it at https://github.com/oalders/go-for-perl-hackers. Comments, critique and pull requests are welcome. I've already had some helpful feedback via Twitter which I've incorporated.

As an aside, I did this a long back for Objective-C.

Smoking Perl

Sawyer X's March 5-25 2018 Perl 5 Porters Mailing list summary put out a call for macOS smoke testers. I thought I would see how far I could get putting one together from the Test-Smoke docs.

The following is not a blow-by-blow (painful and uninteresting to read), but rather what I came up with after a few false starts, with emphasis on what I did over and above the Test-Smoke README documentation, and (sometimes) why.

Environment:

  • macOS 10.13 High Sierra
  • Custom-built Perl installed system-wide in custom directory
  • CPAN client (not cpanp or cpanm) configured to sudo

Procedure:

Perl 5 Porters Mailing List Summary: March 26th - April 2nd

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 with a graphic design donated by Six Apart, Ltd.