With friends like these...

C-o-rr-a-ll-i-n-g d-i-tt-o-e-d l-e-tt-e-r-s

I was going to focus this week on the first task of the 20th Perl Weekly Challenge...but what can I say? The task was a break a string specified on the command-line into runs of identical characters:

    "toolless"        →   t  oo  ll  e  ss
    "subbookkeeper"   →   s  u  bb  oo  kk  ee  p  e  r
    "committee"       →   c  o  mm  i  tt  ee

But that’s utterly trivial in Perl 6:

    use v6.d;

    sub MAIN (\str) {
        .say for str.comb: /(.) $0*/

And almost as easy in Perl 5:

Day Two at the SPW, or is it SPAFW or WSRAK 2019

A rather relaxed day here at the SPW 2019. We started out with a rather animated open discussion of the future on small Perl meet-ups. Seems it is not only the SWP that can have troubble attracting speakers or attendee, people from around the EU Perl community also voiced some concern that organizing small local workshops is getting more difficult.

On suggestion was changed the name or the SPW to something less perlish (which makes sense as Perl6 will soon have its own name). Another suggestion was joining up with more regional PM groups in the Alpine area to attract a few more attendees and organizers. Personally I have seen the same problems come up in other user groups, not a sign of decline but more a sign that the days of the small workshop may be numbered.

Perl Weekly Challenge # 21: Euler's Number and URL Normalizing

These are some answers to the Week 21 of the Perl Weekly Challenge organized by Mohammad S. Anwar.

Spoiler Alert: This weekly challenge deadline is due in several days from now (August 18, 2019). This blog post offers some solutions to this challenge, please don't read on if you intend to complete the challenge on your own.

Challenge # 1: Euler's Number

Write a script to calculate the value of e, also known as Euler’s number and Napier’s constant. Please checkout this wiki page for more information.

The number e is a mathematical constant that is the base of natural logarithms: It is the unique number whose natural logarithm is equal to 1 and its value is approximately 2.71828.

Euler's Number in Perl 6

Perl 6 has a built-in constant, e, for Euler's number, which we can just print:

$ perl6 -e 'say e'

CPAN Game: 100+ days of daily CPAN upload

Yes, I am back again with another blog. I just need a reason to write about. This time, I am going to talk about one of the most fun game I am involved with for long time. In short, this game requires you to upload one distribution to CPAN every day. It sounds simple but it is far from simple.

Current Chains

All-time Chains

Screenshots taken from Neil Bowers personal website.

If you don't know the history of the game, let me give you little introduction, I was first introduced to the game by one of the blog by Neil Bowers. I got addicted to it from day one. Few months later, Barbie blogged once he completed one year of CPAN uploads. It worked like a catalyst to my already addiction.

Solving two problems

A Regular Question

This weeks perl weekly challenge had a pretty straightforward question: take a string and split it when the characters change. That's a fairly straightforward regex issue:

perl -pE's/(.) \g1*/$& /gx'

Here we match any character (.) once. We capture this in a group. Then, we use backreferencing to match as many more copies of that group as we can. We use the s operator to then replace what we found with itself ($& is the entire match that was found) followed by a space.

Conveniently, the challenge didn't specify what 'splitting' entails, so this is technically all we need to do. However, it gives us an extra empty space at the end of the match. In order to get rid of that (the proverbial second problem introduced by regexes), we have two approaches.

The RegEx Rabbit Hole

We could tell the regex not to match if it gets to the end of the string. We would do that with a zero width negative lookahead:

Day One at SWP 2019 Olten

Day one here at the SPW coming home again the Florian in Olten CH.
We started the day with Liz Mattijen debunking myths found on the inter-web about Perl 6, Raku, Cammila ah what-ever they are calling it these days.

Liz was very passionate about Perl6 and it was a little sad to hear her story the state of Perl 5 and Perl 6 but we can always hope.

I was up next and was a little flustered to go up next to one of the legends but I think my talk on the history of routes and my personal style of writing route when ok, at least the crowd laughed at the parts I though where funny.

Perl Weekly Challenge 020: Split on change + amicable numbers

I spent this week in Rīga at the Perl Conference. I had two talks there, a standard 20-minutes one and a lightning talk (5 minutes). I dedicated all my free time to the preparation of the slides, but fortunately the assignments were rather easy this week, so I submitted the solutions on Monday already before leaving for Rīga.

The PerlCon 2019 Riga - Report

Last week, I attended my second European Perl Conference in Riga (PerlCon). I was very lucky this time, I went alone for the Conference and arrived at the hotel a day before i.e. 6th August 2019.

At the airport, I met Mark Keating and his team waiting for their taxi to take recording kits. I booked my taxi and went to the hotel by myself. By the time, I reached hotel, it was 12 'o clock but the check-in time was 3 pm. I had to kill few hours before I could check-in. I saw Barbie and his team in the Lounge relaxing. I feel so confident now that I went straight to him to say "Hello". He suggested place across the bridge for quick tour. I handed in my trolley bag and went on a short tour.

My PerlCon 2019 report


Perl Weekly Challenge # 20: Split String on Character Change and Amicable Numbers

These are some answers to the Week 20 of the Perl Weekly Challenge organized by Mohammad S. Anwar.

Spoiler Alert: This weekly challenge deadline is due in several days from now (August 11, 2019). This blog post offers some solutions to this challenge, please don't read on if you intend to complete the challenge on your own.

Challenge # 1: Split String on Character Change (P5 and P6)

Write a script to accept a string from command line and split it on change of character. For example, if the string is "ABBCDEEF", then it should split like "A", "BB", "C", "D", "EE", "F".

For this, it seemed fairly obvious to me that a simple regex in a one-liner should do the trick. Well, it turned out to be slightly more complicated that I anticipated in Perl 5. For example, running this very simple Perl 5 one-liner:

$ perl -E 'say join " ", "ABBCDEEF" =~ /((.)\2*)/g;'

Driving in Perl

Redhat just posted a podcast entitled "Diving for Perl" and also (strangely) "Driving in Perl" on some pages.

Blurb is as follows:

Languages come and go. A few have the right stuff to rise to the top--and fewer stay there. Perl had a spectacular rise, a quiet slump, and has now found its place in the world of programming.

Perl seemed destined to rule the web. Michael Stevenson and Mike Bursell describe how Perl's design made it ideal for the early web. We hear from Conor Myhrvold about its motto: "There is more than one way to do it." Elizabeth Mattijsen shares how--despite Perl's strengths--a long development cycle slowed Perl's growth. And although it's not the top web language anymore, John Siracusa points out that Perl lives on as a niche tool.

Check it out here

Greed is good, balance is better, beauty is best.

Avidis, avidus natura parum est

One of my first forays into Perl programming, 20 years ago now, was a tool that takes a piece of plaintext, analyzes its structure, and formats it neatly for a given line width. It’s a moderately sophisticated line wrapping application that I use daily to tidy up email correspondence, software documentation, and blog entries.

So the second task of the 19th Perl Weekly Challenge—to implement a “greedy”
line-wrapping algorithm—is in many ways an old friend to me.

Greedy line wrapping simply takes each word in the input text and adds it to the
current line of output unless doing so would cause the output line to exceed the required maximal line width, in which case it breaks the line at that point and continues filling the second line, et cetera. So a 45-column greedily wrapped paragraph looks like this:

announcing Data::Table::Dynamic

Looks like I like tables. But unlike Math::Matrix this will be about organizing any data.

Dancer2 0.208001 Released

The Dancer Core Team just released a minor update, which is on its way to your favorite CPAN mirror now. The fixes include:

  • GH #1515: Add Types::Standard to cpanfile (Russell @veryrusty Jenkins)
  • GH #1513: Fix Dancer2::Test typo (Utkarsh Gupta)

Keep on Dancing!

Giblog 1.0 Released Git Managed Websites and Blog Generator

Giblog 1.0 released. Giblog is a tool for generating a Web site and blog generation tool that can be managed by Git produced by Perl seminar.

Giblog 1.0 Released

Website created by Giblog

You can easily create a static website that can be managed by Git.

Git manage all pages

Advanced SEO measures


Inquiry form

Fast rebuild

Advanced security

Easy search and replace of articles

Windows Mac Linux compatible

Customize freely with Perl

Rebuilt 645 pages in 0.78 seconds. You can manage all of the pages as static files, so you can freely edit and replace using Perl.

Since everything is a static page, the strongest security that does not create vulnerabilities such as page rewriting.

Windows, Mac, Linux compatible.

Function requests such as adding a Twitter card can be realized using Perl.

Upload to Github Pages and your page will be ready.

We also support inquiry form if you can use CGI.

By default, it provides advanced SEO measures that have been proven in Perl seminar.

Smartphone compatible by default. Modern website design is also available with CSS modifications.

Of course Giblog official site is produced by Giblog!

Try Giblog

Perl Weekly Challenge 019: Five Weekends and Paragraph Wrapping

This week’s challenge was a bit easier than the recent ones, but I was glad for that. The Perl Conference in Riga is coming and I still don’t have my slides ready!

Five Weekends

Write a script to display months from the year 1900 to 2019 where you find 5 weekends, i.e. 5 Fridays, 5 Saturdays, and 5 Sundays.

I started by running the cal utility (part of the util-linux package) to see how such months might look. For example, this is the output of cal 1904 (5 weekends highlighted manually be me):

next Math::Matrix releases

As you can see in the Changefile, there is a lot stuff coming in the next release of Math::Matrix, the de facto standard for now for Perl 6 Matrix Math, as mentioned in the docs. However, I have further plans I want to announce here and also ask my readers if I should do the proposed change of name space or not. This should be maybe a lightning talk in at TPC in Riga, but I already have a regular and a lightning there, so I choose this format.

London Perl Workshop - 2019

With great pleasure, we would like announce the London Perl Workshop 2019. After 12 years, we're moving on from Westminster University to David Game College, 31 Jewry St, London EC3N 2ET. Thanks to Westminster University for hosting us for so long. We are holding the workshop a little earlier than normal because we wanted to avoid clashing with various other things and not be too close to Xmas We would like to invite you to join us for one day technical conference on Saturday 19th October 2019.

You could register if you don't already have an account otherwise login and register.

We are also accepting talk proposal now. If you would like to be a speaker at London Perl Workshop 2019 then please submit your proposal as soon as possible.

You are free to pick your favourite technology to talk about whether it is Perl 5, Perl 6 or any other languages/technologies.

Last but not the least, we are looking for sponsors. For more information, please visit the page.

We hope to see you there,

Tom, Lee, Katherine, Julien and Mohammad (the organising team)

It's time to consider avoiding IP fragmentation in the DNS

An article on APNIC was posted earlier this month with the above title. It demonstrates the impacts of IP fragmentation in DNS by demonstrating two successful attacked using it. It is notable to us on this blog because all the examples are in Perl, in addition to everyone hopefully being concerned with running or using reliable and secure DNS.

Check it out at: https://blog.apnic.net/2019/07/12/its-time-to-consider-avoiding-ip-fragmentation-in-the-dns/

Windows and Perl

Doing development work on Windows is becoming easier and better all the time. However, it's still somewhat cumbersome to do development work ON Windows, FOR Windows.

Luckily for us Perl developers, the team making Strawberry Perl have done an excellent job for quite some time. Their efforts make installing and using Perl on our Windows environments (PowerShell or cmd.exe) dead simple.

That being said, something we find ourselves doing more and more frequently when doing development work on Linux is switching between versions of Perl quickly and easily. This has been available to us with BerryBrew for some time.

What Have I Done?! (PSPerl)
What I've started work on recently is a PowerShell version of a Perl environment switcher, called PSPerl. On linux we have perlbrew and plenv, why not have another option on Windows?

Given that it's written entirely in PowerShell v5+, it should be easy to update, maintain, and add new features - or even implement your own features. Give it a try. Find problems. Help me fix them.

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl and offering the modern features you’ve come to expect in blog platforms, the site is hosted by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.