Since I didn't put any new code in yesterday just take out I figure I might as well do that little validation I talked about in my last post namely you can only have one aggregate function inside another aggregate. As usual I start with a test;
I must admit that I love Perl, but sometimes it forces me to go through the documentation to get what I need. In this case, I will try to summarize how I managed to decode the text string 80jNyclXKM8vykkBAA== , which I found in a PHP file in a code with the nested functions gzinflate(base64_decode()).
The history.
I found this text string while analyzing the folder /wp-content/ into blog www.vozidea.com, which according to its owner, it seems that someone left that file there during a time when the web had a vulnerable WordPress plugin with security issues.
That string was something disturbing for the administrator of the blog, a person outside the programming. But in reality it is very easy to decode using PHP, the following code would suffice:
In one of my pieces of software, Mock::Sub, I recently found that I wanted to add a new feature, and as always, I wrote a test file for the new work before modifying code. After making the first round of changes, I stumbled upon a previously unknown bug, so I opened an issue, and decided to tackle that before adding the new feature, to ensure all previous tests would run.
The new feature is quite minor and actually requires a specific parameter to be sent in to change existing behavour (ie. no existing code that uses the distribution should have been affected), but the bug was a little more complex, and did change things internally.
After I got the bug and new feature added, and before just blindly uploading it to the CPAN, I of course wanted to know whether the reverse dependencies (down-river distributions) would not be adversely affected, which would cascade Testers failure emails to the poor souls who's distributions I broke (most are mine in this case, but I digress).
One of the words in the description of the item is パーティスマスツリー, which seems to be "party-mas-tree". You might think that is some kind of Japanese neologism, but there's no such word as "パーティスマスツリー" in Japanese. A google search just brings you back to Amazon.co.jp.
So I was all prepped and ready to start on the aggregate command for SQL as I had research the MongoDB and other similar non-sql dbs and they all shared the same basic set of commands. I even started writing up some tests starting with this SQL
SELECT person.last_name,SUM(person.pay) FROM person GROUP BY person.last_name
all well and good you need to use the group by with that aggregate. However I forgot that about 90% of the dbs out there let you do this
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.
(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.
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.
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.
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.
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.
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;
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!
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.