Data analysis and visualization in Perl

position_stack_02_02.png

Hello everybody, this is my first post here, so forgive me if I screw it up.

Let me firstly introduce background of my work. Several years ago I landed onto a Perl job. It also involves some other languages like Python and R, but it was mainly Perl, until last year focus of my role switched and I still do some Perl but much less since then. I was a little bit sad. Perl is indeed a good language, but usually underated outside its community. I am quite good at several programming languages, but with Perl I feel most comfortable and productive. So I thought I might write something at my after-work time, to use my Perl knowledge to create something to give back to the Perl community.

Native Variable-Length Lookbehind

No, I'm not talking about Dr. Regex' emulated variable-length lookbehinds, which frankly make my head hurt. Beginning with Perl 5.29.9, Perl has honest-to-heaven, really truly variable-length lookbehinds.

Now, there is at least one restriction. No lookbehind assertion can be more than 255 characters long. This limit has been around, as nearly as I can tell, ever since lookaround assertions were introduced in 5.005. But it has been lightly documented until now. This restriction means you can not use quantifiers * or +. But bracketed quantifiers are OK, as is ?.

As Perl tracks Unicode's case-folding rules, variable-length lookbehinds are becoming increasingly hard to avoid, and can crop up in inobvious places. Witness Perl Porters thread 245323 and its associated RT ticket.

What happened here is that Unicode decided that (e.g.) /ss/i should match the German sharp s. This is not the only example -- ligatures are treated the same way. So a regular expression with no quantifiers at all suddenly becomes variable-length simply by making it case-blind. Discussion in the RT ticket seemed to be leaning toward special-casing the problem characters, but it was the general case that got released.

So now you can match things like /(?<=fo{2,20})bar/. It's still marked experimental, though.

LPW 2018 Videos and EPO Conference Video Initiative

The London Perl Workshop 2018 videos are now available to view on YouTube: Playlist. It's taken us a bit of time to put these together due to last minute equipment issues, which led to more post processing / editing than anticipated.

The videos were recorded using the equipment purchased for LPW 2017, which has since been expanded by The Enlightened Perl Organisation (EPO). We want this equipment to be available to other workshops/conferences/tech meets, to allow high quality recordings at very low cost, so have added the details to the EPO Conference Video repository on github for view/contribution.

As always, thanks to our sponsors who made LPW 2018 possible:

- Eligo
- Perl Careers
- CV Library
- Adestra
- Broadbean
- Oleeo
- OpusVL
- The Perl 6 Community
- Adzuna
- Geekuni

Perl Weekly Challenge - FAQ

Here I compiled the questions that have been asked by people on Twitter and by email. If I missed anything then please correct me. I will put this FAQ on the official online portal with the launch.

Q) When is the launch date for the "Perl Weekly Challenge"?
A) It is going public with the first challenge on 25th March 2019.

Q) How can I join the "Perl Weekly Challenge"?
A) You just send one line email to perlweeklychallenge@yahoo.com. However we would like you to tell us about yourself in couple of lines e.g. your preferred choice of language, how long you have been using the language, your city and country. If you could send us your recent photo then that would be great to show on the team page but not required.

Q) When do you send the challenge?
A) The plan is to send weekly challenge to all subscribed team members every Monday.

Module::Lazy - postpone module loading until actually used

This module is designed to improve load times for applications with huge dependency footprint. It is somewhat similar to autouse, but more focused on object-oriented modules. See:

use Module::Lazy 'My::Module';

This creates a fake package My::Module with AUTOLOAD, DESTROY, can, and isa redefined.

my $object = My::Module->new;
my $value = My::Module::some_function();

Either of these triggers loading My::Module in full.

no Module::Lazy;

Preload all lazy methods right away, forbid further lazy-loading. This may be useful for long-running, mission-critical apps.

use Module::Lazy;
Module::Lazu->unimport();

Ditto, but at runtime (say after parsing command-line parameters and before daemonizing).

Sure, there are some caveats with using it, but maybe it's still helpful for your project. We managed to reduce test suite execution time from ~17 to ~9 minutes with this one.

We start Mojolicious 8.12 Japanese translation

I found a friend who helped me with the translation of Mojolicious.

We start to translate Mojolicious 8.12 to Japanese.

Mojolicious Japanese Translation

This translation have helped Japanese Mojolicious users.

"I always see this translation when I have trouble in Mojolicious"

Impressions from the German Perl Workshop 2019

Another edition of the German Perl Workshop took place in Munich from 6th to 8th March 2019. I very much enjoyed taking part. Let me share some personal remarks.

Things I learned

My Twin Projects


Last week, 2 projects kept me busy, one is "Perl Weekly Challenge" and the other is "London Hack Day".

Perl Weekly Challenge

I have created dedicated email account for the group i.e. perlweeklychallenge@yahoo.com so that I no longer have to use my personal email. Second I created a twitter account to spread the word about the forthcoming challenges i.e. @PerlWChallenge. If you are active on Twitter, I request you to please follow the twitter account and spread the word. I have started working on dedicated web portal and registered a domain as well. I am using Hugo to generate the contents. With the help of GitHub pages, we are planning to go public on 25th March 2019 with the first challenge for both Perl5 and Perl6. I have informed the team members about the progress we have made so far. I am hoping more will join after the official launch of the event. Fingers Crossed.

London Hack Day

German Perl Workshop 2019 in Munich Report

See here on my blog!

P.S. As http://ironman.enlightenedperl.org/ seems to be down, I'm back to using blogs.perl.org for syndication...

Idea of Raku

Raku is another name of Perl 6.

Use more Raku in more place for people to understand it is another name of Perl 6.

Create raku command which is same as perl6 command.

Create .rk or ra extendion which is same as .pl6 extension.

Create .rm extension which is same as .pm6 extension.

Keep peace, Keep peace, Keep peace. Do not hurt Perl6 commnity.

Release name keeps to be "Raku Perl 6 'Diwali' 6.d" before people understand Raku is a Perl 6 another name.

This release name is not desirable name. This release name is temporary name before people understand Raku is a Perl 6 another name.

Start to write raku example in more place and documentation.

After sevral years, pelope start to understand Raku is a Perl 6 another name.

"Perl 6 is confusion name for outer people of Perl community. Perl 6 is called Raku lately ."

Keep all of perl 6 for member of Perl 6 community. Don't break anything.

Name of Raku is for outer people to distinguish Perl 6 with Perl 5 correctly.

RPerl and the Google Summer of Code

The next Google Summer of Code has been launched, and The Perl Foundation is part of it! Several Perl 5 and Perl 6 projects are available for computer software students to join. Among those, RPerl is present, under the title "Perl 5 RPerl: Built-In Operators". Will the Chill will be the lead mentor for this project. All the details are available here:
perl-gsoc-2019.github.io/ideas/perl5/RPerl_Operators.html

Also, here is The Perl Foundation page on GSoC:
summerofcode.withgoogle.com/organizations/4713351599357952/

The Google Summer of Code is a great opportunity to create more code that will be available to the open-source community. Students have until April 9th to apply.

Good luck to all the Perl projects involved!

wbraswell_20190228-google_summer_of_code_screenshot_cropped.png

PS - We've just launched the official Team RPerl page on Patreon!
Special thanks to our first 5 Patrons: Packy Anderson, Tommy Butler, Harry Braswell, Debbie Sonnycalf, and John Stuke

Monthly Report - February

February had been much better than January in many ways. First, I didn't get any cold or flu and second I finally got my hand dirty for the first time with Perl 6. For me it is a big thing, I have been planning to do for more than a year now. It was one tweet that put everything in place, thanks to JJ Merelo and Simon Proctor. I must thank all the experts in Perl 6 IRC channel for all the help so far. It has been only one week and I already submit handful of PR to Perl 6 code base. I even joined the Perl 6 GitHub organisation that gives me exposure to what others are contributing. One other thing that happened in February, I announced Perl Weekly Challenge to public. I have had good response so far but I am looking for more people to come forward and join the team.

Let's take a quick look through last month activities.

HTTP requests, simply

It's long been common to use the LWP::Simple module for quick HTTP requests where you only need to retrieve the contents of a website and put them somewhere. Nowadays I would highly recommend the very neat ojo module from the Mojolicious framework for oneliners, but I have created another alternative using just core modules.

HTTP::Simple implements similar functions to LWP::Simple using the core HTTP::Tiny. One other important difference is that it will throw exceptions whenever there is an error, rather than sometimes returning undef which the user can't do anything with. For oneliners, exceptions are very useful as they will print out what went wrong and cause the script to exit with a failure code; for scripts, they can be easily handled with modules like Syntax::Keyword::Try to perform the appropriate action.

Raku is peaceful name

Raku is peaceful name.

I hope the discussion of names will decrease and talks about language features will increase.

In fact, both languages have been attacked from inside and outside of community because of problems of names.

Larry Wall made the decision to use Raku as its official name.

Why do not you try to reduce a lot of confusion of past days?

Swiss Perl Workshop 2019 - August 16th & 17th 2019

The dates for this year's Swiss Perl Workshop are now confirmed after our poll to ask interested attendees on their preferred choice:

spw_poll_mar_1st.jpg

Although the date is close to The Perl Conference in Riga, just one week later in fact, this infers some advantages: we hope to appeal to overseas visitors who are attending TPC, including potential speakers, the dates in October turned out to clash with Swiss personal and school holidays, and we will be able to use the excellent kitchen team for snacks and lunches as we did in 2015 :)

The workshop will be free to attend once again, so please, register, think about submitting a talk, and perhaps even sponsor the workshop.

A great thanks go to our sponsors, who have already committed to the event:

USB::LibUSB 0.06 released

libusb is a highly portable library providing generic access to USB devices. USB::LibUSB was newly written in 2017 to provide Perl bindings to the libusb-1.0 API. It replaces the deprecated module Device::USB, which targeted the older and incompatible libusb-0.1 API.

This release of USB::LibUSB fixes a bug in the config descriptor data structure. Before the fix, only the first interface of a given configuration was represented. Now, the "interface" element of the config descriptor hash holds an array of interfaces, each of which consists of an array of alternate settings. Typically each interface has only one alternate setting:

my $config = $dev->get_active_config_descriptor(); 
my @interfaces = @{$config->{interface}};
# Get first alternate setting of first interface
my $first_interface = $interfaces[0]->[0];

Many thanks to Mike Ferrara who spotted the issue when porting code from Device::USB to USB::LibUSB.

Site perlbanjo.com is released! Run & share Perl code in the browser.


Long story short: today I'm happy to release a simple tool, a website that you can use to run & share Perl code.

https://perlbanjo.com

There are great web tools in Perl ecosystem:

  • CPAN & PAUSE - repository to store and upload Perl libraries
  • https://metacpan.org - interface to explore and view Perl libraries
  • http://cpantesters.org - system that runs tests for all Perl libraries and shows results
  • https://kritika.io - static code analysis system
  • and others (sorry not to mention them all)

But I always missed a simple tool to share Perl code. Yes there is https://gist.github.com/ and a lot of other pastebin sites, but they just share the code without the ability to run it.

In browser you can run Perl code at http://perltuts.com, but there is no way to save your work and to share it with others. There is a tool that you can use to run & share Perl code https://ideone.com/, but it is complicated and you can't use perl one-liners in it.

Let's use Raku more.

Raku Language.

Raku Programming.

Raku Programmer.

Raku Conference.

Raku Monger.

Raku WorkShop.

Raku Module.

Raku Script.

Array of Raku.

Hash of Raku.

YARC

etc, ...

London.pm - First Tech Meet of the year 2019

Last Thursday, 28th February 2019, London Perl Mongers group organised first Tech Meet of the year 2019. Thanks to Zoopla for giving us space to hold the meet. Also for Pizzas and drinks.

In the past, I never made any effort to attend the Tech Meet. On 9th November 2017, I attended my first Tech Meet. It was to meet and greet Neil Bowers as the invitation had his name as one of the speakers. I blogged about it. Ever since, I haven't missed a single Tech Meet. It is so fun and entertaining.

This time also it was such a great event with mix of regular and new speakers. I got to meet LPW team after such a long time. Two members were still missing. Rick and Lee. Luckily, Julien and Katherine made it. Julien even gave a short talk that he is planning to give in the next German Perl Workshop as well but in German.

Need an Accessible Room for #TPCiP?

Accessible rooms have been popular this year at our venue hotel. Unfortunately, sometimes people will book an accessible room when they don't actually need one. We want to make sure that those who truly need accessible rooms have the chance to book them. #TPCiP has held two more accessible rooms back just for this reason. If you need extra accommodation and haven't reserved your room yet, email admin@perlconference.us so we can help ensure you get an accessible room at the conference rate!

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.