What's new in Proxmox VE 5.4

Proxmox VE is a virtualization and LXC platform - all written in Perl.

I wrote most of the the Perl client API on the CPAN - and use it with quite a few $clients.

Proxmox VE 5.4 introduces new features:

- Debian Stretch 9.8 and Linux Kernel 4.15.
- New installation wizard for Ceph in the UI,
- New HA policies freeze/fail-over/default for greater flexibility,
- Suspend to disk/Hibernation support for Qemu guests,
- Support for Universal 2nd Factor (U2F) authentication,
- Improved ISO installation wizard,
- New options for Qemu guest creation wizard

View the detailed release notes: http://pve.proxmox.com/wiki/Roadmap

Atomic Updates with DBIx::Class

As we're building Tau Station, a narrative sci-fi MMORPG written in Perl, we've encountered any of a number of challenges, not the least of which is that this is a very "write-heavy" application. Further, because it's a universe where people interact, there's often no clear isolation between what you can change and what I can change. Thus, there's a lot of writing to the database and often to the same data!

By now you've probably heard of the Object-Relational Impedance Mismatch, which is just a fancy way of saying "collections of objects and databases aren't the same thing."

One problem which is particularly difficult is handling "syndicate credits". Syndicates ("guilds" in other MMORPGs) can tax their members and every time a member gets credits deposited in their bank account, a certain percentage goes to the syndicate. So let's say two syndicate members each earn 100 credits at the same time, paying 10% tax to their syndicates. It can look like this:

Rakudo.js update - running tests in a real Chrome

What now works

We now can parcel up and pass tests from our chosen subset under a real Chrome (for testing purposes a Headless Chrome controlled by puppeteer ).

Our test runner is in https://github.com/pmurias/perl6-js-roast-test-runner

It runs tests using a precompiled working version of rakudo.js fetch from npm using a roast revision we know passes.

What's missing or fudged?

Tests that are broken under precompilation on all backends

In the browser we precompile tests before running which means the tests are run differently then
how they are tested on other backends.
As a result a whole bunch of tests fail under precompilation even on the Moar backend.
They need to be fixed as they are real bugs in Rakudo on all backends (as most proper codes
tends to live in precompiled modules not scripts) but that's work separate from the js backend.

Tests that don't make sense in the browser itself.

Hi from dibs... and more

I worked on a tool named dibs in the past months, and I started writing about it:

I hope you will enjoy them!

Perl Weekly Challenge: Week 2

These are some answers to the Week 2 of the Perl Weekly Challenge organized by the hugely prolific CPAN author (and, besides, very nice chap) Mohammad S. Anwar.

Challenge #1: Removing Leading 0's

Write a script or one-liner to remove leading zeros from positive numbers.

A Perl 5 One-Liner

This uses a simple regular expression to remove zeros from the start of the string. Here, we're just using bash for piping four lines with input numbers to a very simple 7-character Perl 5 one-liner.

Swiss Perl Workshop 2019 - Call For Papers

This year's Swiss Perl Workshop is just a few months away, and we're looking forward to another interesting and fun event in Olten. The workshop takes place just a week after this year's The Perl Conference in Riga so perhaps if you're attending one you could spend a little more time in central Europe and attend the other, and if you're planning to give a talk at The Perl Conference then...

Either way, we encourage you to submit talks and we welcome a broad range of subjects, your talk does not have to be specifically Perl related. Share your experience with others, be it your daily messing around with bugs, writing interesting modules, hardware hacking, Perl 5, Perl 6, devops, and so on.

One thing to note for any attendees is that the wonderful kitchen crew from previous years will be helping us again in Olten, and we would like to give them a list of dietary requirements as far as possible in advance. If you need to let us know of this then please tell us by adding information to the SPW Wiki here.

We look forward to seeing you in Olten this August.

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

Thruk 2.28 released

Details available on http://thruk.org/whatsnew/v2.28.html ... and http://thruk.org/changelog.html

Thruk is a multibackend monitoring webinterface which currently supports Naemon, Nagios, Icinga and Shinken as backend using the Livestatus API. It is designed to be a 'dropin' replacement (for Nagios web UI etc) and covers almost 100% of the original features plus adds additional enhancements for large installations and increased usability. Written in perl.

(I am not a project contributor, just a fan who uses it and has "upgraded" several $clients from Nagios to Thruk+Naemon)

Monthly Report - March

Perl Weekly Challenge, First Week

I am glad that Mohammad Anwar started the Perl Weekly Challenge. Since it seems that the entries will not be published by Mohammad, this gives me the opportunity to finally publish my first post here, about 8 months after having registered.

Week 1, Challenge # 1: Letter Substitutions

Substitute every ‘e’ with upper-case 'E' in the string “Perl Weekly Challenge” and count every occurrence of ‘e’.

For this challenge, I proposed only a Perl 5 solution, in the form of a Perl one-liner:

$ perl -E 'my $c = shift; my $num = $c =~ tr/e/E/; say $c; say "Number of replacements: $num";'  'Perl 6 Weekly Challenge'
PErl 6 WEEkly ChallEngE
Number of replacements: 5

Nothing special about it, except that the tr/// operator returns the number of substitutions it has performed, so there is no need to count separately the 'e'.

"Sherlock Holmes & the Case of the Missing Parsing Solution"

There is a new blog post at my Ocean of Awareness blog: "Sherlock Holmes and the Case of the Missing Parsing Solution" .

How to serve Static HTML file and CGI script in development environment

How to serve Static HTML file and CGI script in development environment.

I write simple implementation with Mojolicious.

morbo serve_cgi.pl

Austin Perl Mongers Hackathon Planning - Part 1

Exciting news from Austin, TX!

The Austin Perl Mongers are launching our very first full Hackathon. It is scheduled for late April, on two weekends, Saturday 20th and 27th. Our goal is to create a Perl class for teenagers. We will achieve this at the Hackathon by upgrading the CloudForFree platform, adding graphics, and a live development feature. The students will be able to see the result of their coding, as they write their code! It can make the learning of programming more accessible to teenagers, and it introduces them to Perl.

The project managers for this Hackathon are yours truly and Bonnie Cope, a programmer and Perl enthusiast. Will 'the Chill' Braswell, creator of the platform, is one of the programming team leads.

You can check out the CloudForFree platform on http://cloudforfree.org

20190328-austin_perl_mongers_christmas_party_big_bennie_bonnie.jpg

Enforcing Simple Standards with One Module

It's fair to say that at our consulting company, we work with many clients who use Perl heavily. The "preamble" of their Perl code is either an ad-hoc mixture of features, or stock boilerplate like this which gets cut-n-pasted all over the place:

use strict;
use warnings;
use v5.24;
use feature "signatures";
no warnings 'experimental::signatures';
use utf8::all;
use Carp;

Both of those approaches are dead wrong. The "ad hoc" pragma list means it's hard to be sure what features are or are not available. The "standard boilerplate" approach means cutting-n-pasting and then hating yourself when you have to change that standard boilerplate.

What to do with doubly-broken UTF-8?

I recently got a few test reports like this:

www.cpantesters.org/cpan/report/49de90f8-4ec9-11e9-98fa-fc611f24ea8f

Although I've put all kinds of stuff in my test file:

[https://metacpan.org/source/BKB/Lingua-JA-Moji-0.56/t/katakana2syllable.t#L9-13]( https://metacpan.org/source/BKB/Lingua-JA-Moji-0.56/t/katakana2syllable.t#L9-13)

the cpan testers doesn't like that. How to deal with this garbage characters?

The solution is this:

Announcing the Perl Toolchain Summit 2019

This year's Perl Toolchain Summit (PTS) is being held in the UK, in the historic town of Marlow, which is about 30 miles west of London.

In this post we'll give an overview of the PTS and who attends, the venue, and the plans for this year. All of the attendees are volunteers, who mostly work on the CPAN ecosystem in their spare time, so the event is supported by sponsorship. If your company uses Perl, maybe you could support the PTS?


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.

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.