Penultimate Moose

Its penultimate operator day here in the Moose-Pen

This is just a quick postette today add in what I think is next to last special 'operator' the 'All' and as before I start with a test;

Smartmatch in 5.27.7

What happened?

In the latest development release of perl, smartmatch changed quite a bit.

Almost everything you believed about smartmatching is now wrong

No really, everything. All previous rules are gone except a single one: you can smartmatch against any object that overloads smartmatching (the only "objects" that overload them out of the box are qr// regexps).

Matching against a scalar value? Gone. Matching against a list of values? Also gone.

when is no more.

The when keyword is gone, split into two keywords: whereis and whereso; one smartmatches the value against the current subject and the other does a simple boolean check much like if. I'll let you guess which is which. This split is for good reasons (when sometimes does one and sometimes the other, sometimes depending on things like optimizations), but that doesn't make this any more intuitive.

use 5.010/use 5.028 won't guard you from this.

I wrote a Perl book

(This article is cross posted here and on my own blog)

I wrote a Perl book accidentally during my vacation. I started typing and everything just fell out of my head over the next few days. Its still pretty rough but I think its a decent start.

The book is called Minimum Viable Perl..

mvp-book.jpg

Ok, its not a real published book. Maybe I’ll self publish it on Amazon some day. For now its just a website. I’m going to call it a book anyway.

What its about

This book is for developers who want to get up to speed with Perl quickly through concise tutorials (about 1 screenful in size).

Being concise is one of the primary goals. In the age of stackoverflow and blogs and info graphics everyone is in a hurry. People shouldn’t have to wade through unnecessary prose. I literally review each sentence in each article and try to remove unnecessary words.

Patreon and Perl

Once upon a time there was Gittip that became Gratipay that got shut down. Several Perl developers had account there and many got contributions through that platform.

A few days ago I've started to use Patreon that allows people to support each other on a monthly basis. (Or per creation.)

Searching for perl shows lots of unrelated entries. So it won't be easy to find other people contributing to Perl or writing about Perl.

This is my account: Gabor Szabo on Patreon.

This is the account of David Farrell.

Do you have a Patreon account? Post your link in the comment section so others can find you!

Gorgias Moose

Its solipsism day here in the Moose Pen

Getting down to the last few operators on my list and today I will hopefully be an easy one 'Exists'

At least this one should be easy to validate as you can only ever use it with a sub-query so I will add that in from the start but as always before I hit the Driver::DBI code a test;

(Update) Inline::F2003 - An ILSM for modern FORTRAN

An updated version, 1.01, of “matopmul” has been released on SourceForge. This version contains several fixes for the Inline::F2003 module. In particular, when a new FORTRAN compiler is specified through the FOR => “compiler” configuration option, Inline::F2003 recognises the change and recompiles the FORTRAN source with the new compiler.

Another change is that both Inline::F2003 and Inline::C can now load and execute at Perl’s compile-time. This further implies that the FORTRAN and C sources may both appear under the “__DATA__” section of the program.

Perl 5 Porters Mailing List Summary: December 6th-10th

Hey everyone,

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

Enjoy!

Why I wrote Keyword::DEVELOPMENT

I've had a few discussions with people about why I wrote Keyword::DEVELOPMENT, a useful, but simple module. In short, it lets you do this:

Moose Like

Its one more operator day here in the Moose-pen

Today I am finally going to get around to the last two of my operators the 'Like' and 'Not Like'. This is where we get into sort a sticky wicket and we are entering the realm of 'regular expression' queries which may work quite differently on the various SQL boxes and I know 100% different in MongoDB and other non SQL dbs. So what to do??

Well I might as well go with the standard SQL ones '%' and '_' meaning multiple and single characters, and the next question do I validate for their present in a 'Like' as this sql

WHERE  first_name LIKE 'Bob'
is perfectly valid though not a very good query. I guess no validation then, just pass in what I am given on on the param. Unfortunately like most predicates almost any combination is allowed as

London Perl Workshop 2017 - Talks Review

About a week ago, I published London Perl Workshop 2017 - Report. In the previous blog, I didn't mention anything about the talks I attended. So this blog would focus more on that. First sorry for late review, no excuse is good enough.

YAML::PP Grant Report November 2017

See also my previous reports on news.perlfoundation.org (Aug/Sep, Oct) and blogs.perl.org (Aug/Sep, Oct).

In November, I was working over 40 hours on YAML related stuff.

A Mojolicious Advent Calendar!

I’m happy to announce that this year I’m going to be running a Mojolicious advent calendar from my new “semi-official Mojolicious website” at https://mojolicious.io/blog/. I won’t cross post here every day, though maybe I will do a few, say the most interesting/code-filled ones.

The first one is already up, a quick Getting Started to get the ball rolling.

The site itself is brand new, using Statocles and a nice theme I found online. The main pages are starkly lacking in content so far, but the blog is off and running! Hope to see you there!

Condiment Moose

It is catch up day here in the Moose-Pen.

I was just about to add in the next operator on my, the 'Like' command but before I did that I added a few more tests for the 'in' operator and with this test;

CPAN Testers at meta::hack v2

Two weeks ago, I was invited to meta::hack v2, the second annual MetaCPAN hackathon. As the primary maintainer of CPAN Testers, I went to continue improving the integration of CPAN Testers data with MetaCPAN and generally improve the performance of CPAN Testers to the benefit of the entire Perl ecosystem.

Perl 5’s list-flattening and reference-taking design choices

Eevee:

Perl has the strange property that its data structures try very hard to spill their contents all over the place. Despite having dedicated syntax for arrays – @foo is an array variable, distinct from the single scalar variable $foo – it’s actually impossible to nest arrays.

my @foo = (1, 2, 3, 4);
my @bar = (@foo, @foo);
# @bar is now a flat list of eight items: 1, 2, 3, 4, 1, 2, 3, 4

The idea, I guess, is that an array is not one thing. It’s not a container, which happens to hold multiple things; it is multiple things. Anywhere that expects a single value, such as an array element, cannot contain an array, because an array fundamentally is not a single value.

And so we have “references”, which are a form of indirection, but also have the nice property that they’re single values.

This is a common thing for people to find weird about Perl. Really though it’s just a different default.

Perl’s reference-taking operator is simply dual with the splat operator in Ruby and recent Javascript.

I was at the London Perl Workshop 2017

... and have blogged about it here!

In Moose

Its is in day here in the Moose-pen

Now that I have a few little API things worked out from yesterday's post I better carry on and do the next two 'operators' 'In' and 'Not In'

My original though was these two operators would now require a little parameter validation like I did for the 'Between' as most of us know the very common form of an SQL 'In' queries one like these two;

SELECT * FROM users WHERE id in (SELECT user_id FROM drivers) ;
SELECT * FROM users WHERE id in (109,100,22) ;
should just be handled by the present type and coercion code in the system but I just read that this form of SQL

SELECT * FROM users WHERE id in (SELECT user_id FROM drivers,22) ; 

Perl 5 Porters Mailing List Summary: November 21st - December 5th

Hey everyone,

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

Enjoy!

4 days in Amsterdam with porters


We held a Perl 5 Porters Hackathon in Amsterdam October 12-15. This was our 2nd attempt to bring active porters together to sort out issues that might otherwise take months to sort out. We got quite a bit done.

Deprecation of $[

Last year, we went over all of the long-standing deprecations in core. All but $[ were given an official EOL. $[ was not because we could not come up with a plan.

There are 3 use cases we expect are going on:

  • using $[ in a conditional
  • Assigning to $[
  • Assigning to $[ but making it = 0 which doesn't do anything.

Very few modules on CPAN even mention $[. I provided a grep from the grep.metacpan.org backend. We determined there's roughly 100 lines of code on CPAN which would need to be fixed to eliminate the usage of $[ on CPAN. Ilmari offered to submit patches to fix them.

You can see a more rough list here:
https://grep.metacpan.org/search?q=%5C%24%5C%5B%5Cs*%3D&qd=&qft=

graphql-perl - plugin to make GraphQL "just work" with OpenAPI

The just-released v0.03 of GraphQL::Plugin::Convert::OpenAPI provides a plugin to convert a given OpenAPI specification (the spec formerly known as Swagger) to a GraphQL schema.

There is also now a sample OpenAPI applet for Mojolicious::Lite. It provides a GraphQL interface to the superb CPAN Testers REST API. Here is an example query:

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.