Well Back in the Saddle again.

Finally have a chance to go to a North American Perl event, so after nearly 4 years since my last Perl event, thanks Covid 19 I managed to make my way down from the Ivory Tower in Ottawa to the 'Big Smoke', 'Hogtown', Queen City, TO or as most of the rest of the world knows it Toronto.

So there are about 100 us us Perl types here today, with most participants coming from across the US and Canada but there are a few that came over 'The Big Pond'

So far The talks have been very good, I had a and interesting Talk on Test2 by Chad Granum something I will have to look into as my old test suite is becoming a little flimsy and is a patchwork of kludges,

Cloud Provider Price Performance Comparison: Spot VMs

In my recent Cloud Comparison, I mentioned that I'd look at Spot VM pricing in an update. This is the update - 6 out of the 10 providers tested offer Spot/Preemptible instance pricing.

At SpareRoom we make some good use of Spot VMs. E.g. our perl test suite gets to run on fast VM types at very low cost: currently we are using c3-highcpu-22 instances which normally come at $0.95/hour each. The spot pricing for them is more than 10x lower, at just $0.086/h. At these prices, if our test suite needed it (it's already fast), we'd be able to launch c3-highcpu-176 (176 vCPUs) at well under $1/h!

Perl Weekly Challenge #222 - Checking Against My List of Members

Hi everybody! Just doing the first weekly challenge task again this week. This week we're sorting a list of numbers and then checking whether the number matches the same position in the unsorted list. It's a very simple challenge and easily written in about 4 actual lines of clean code.

Here's the code:

#!/usr/bin/perl
use strict;
use v5.24;
my @sorted = sort @ARGV;
my $matches;
for (my $i = 0; $i <= $#ARGV; $i++) {$matches++ if $ARGV[$i] == $sorted[$i]}
say $matches // 0;

Perl Weekly Challenge 262: Count Equal Divisible

These are some answers to the Week 262, Task 2, of the Perl Weekly Challenge organized by Mohammad S. Anwar.

Spoiler Alert: This weekly challenge deadline is due in a few days from now (on March 31, 2024 at 23:59). This blog post provides some solutions to this challenge. Please don’t read on if you intend to complete the challenge on your own.

Task 2: Count Equal Divisible

You are given an array of integers, @ints and an integer $k.

Write a script to return the number of pairs (i, j) where

a) 0 <= i < j < size of @ints

b) ints[i] == ints[j]

c) i x j is divisible by k

Example 1

This week in PSC (109) | 2023-06-09

Today’s PSC call was another pretty short one.

  • We agreed on the change HTTP::Tiny, our last blocker, and hope to have RC1 tomorrow.
  • There are a few minor notes on the RC0 status on p5p, which need addressing. Nothing major.
  • We discussed the things we need to do to arrange the next PSC election, scheduled for post-v5.38.0.
  • We discussed libperl.t, which fails on newest macOS+Xcode even in stable. It’s fixed in blead, and we should fix maint-5.36, too

MooseX::Extended versus the debugger

I've released MooseX::Extended 0.35 and it resolves a long-standing bug. If you tried to use multi subs, it would trigger this bug in Syntax::Keyword::MultiSub. To fix that, you had to manually patch the latter module:

--- old/lib/Syntax/Keyword/MultiSub.xs  2021-12-16 10:59:30 +0000
+++ new/lib/Syntax/Keyword/MultiSub.xs  2022-08-12 10:23:06 +0000
@@ -129,6 +129,7 @@
 redo:
     switch(o->op_type) {
       case OP_NEXTSTATE:
+      case OP_DBSTATE:
         o = o->op_next;
         goto redo;

Not good. However, Syntax::Keyword::MultiSub 0.03 has been released with that patch included, so that's a relief.

However, I was still struggling with switching WebService::OpenSky to MooseX::Extended but under the debugger, we have a serious problem.

Perl Weekly Challenge #221 - Good Strings, Bad Strings

Hi everybody! Very limited time this week so just a brief blog post.

This week we're looking for any words in the list that can be created only using letters from a dictionary string. Then print the number of characters in the good words.

Here's the code:

Perl Weekly Challenge 262: Max Positive Negative

These are some answers to the Week 262, Task 1, of the Perl Weekly Challenge organized by Mohammad S. Anwar.

Spoiler Alert: This weekly challenge deadline is due in a few days from now (on March 31, 2024 at 23:59). This blog post provides some solutions to this challenge. Please don’t read on if you intend to complete the challenge on your own.

Task 1: Max Positive Negative

You are given an array of integers, @ints.

Write a script to return the maximum number of either positive or negative integers in the given array.

Example 1

Input: @ints = (-3, 1, 2, -1, 3, -2, 4)
Output: 4

Count of positive integers: 4
Count of negative integers: 3
Maximum of count of positive and negative integers: 4

Example 2

Perl Toolchain Summit 2023 in Lyon

Four years have passed since the last Perl Toolchain Summit (PTS) in Marlow. I planned to continue working on PAUSE's web UI, but I didn't exactly remember what to do. So the first thing I did at home before the PTS was to read through the PAUSE issues and do some triage. I also resumed a virtual machine that held PAUSE clones I had worked on. There I found an untracked docker-compose.yml. It was incomplete. I must have given it up because I already had a working environment. However, I remembered a few people wanted an easier way to install PAUSE. It would be helpful if they could run PAUSE on docker. Thus I started filling missing parts of the YAML file. After making a few serious mistakes, I made a draft pull request on the first day of the PTS. Matthew Horsfall took it over then.

This week in PSC (108) | 2023-05-26

After skipping last week, Rik and BooK met today and we:

  • happily confirmed there are no release blockers left
  • looked at HTTP::Tiny, which might really be one last blocker
  • reviewed the PPC list (see separate email)
  • think we’re ready for RC1!

Perl Weekly Challenge #218 - Feeling Negative

Hi everybody! Back this week with a solution to just the first challenge project. I know I won't have time for the second one, plus I'm not sure of an efficient solution. I really liked this first one, though! I got to try some new techniques in it.

Spoiler alert, since I know it's only Wednesday/Thursday depending on where you are, but if you're looking to solve this challenge yourself you might prefer not to read this yet.

So the goal of the first challenge is to find the 3 integers in a list that have the greatest product, and print the product.

First, here's the code as usual:

Perl Weekly Challenge 261: Multiply by Two

These are some answers to the Week 261, Task 2, of the Perl Weekly Challenge organized by Mohammad S. Anwar.

Spoiler Alert: This weekly challenge deadline is due in a couple of days from now (on March 24, 2024 at 23:59). This blog post provides some solutions to this challenge. Please don’t read on if you intend to complete the challenge on your own.

Task 2: Multiply by Two

You are given an array of integers, @ints and an integer $start.

Write a script to do the following:

a) Look for $start in the array @ints, if found multiply the number by 2

b) If not found stop the process otherwise repeat

In the end return the final value.

Example 1

TWC 217: Big and Boundless in The Matrix

In which I must change a conference talk.

This week in PSC (107) | 2023-05-12

  • We went through the release blockers list again. One is now fixed (21044), one more should be closable once a perldelta PR is merged (20384), one more remains (21073)
  • We discussed the funding of some Perl events (like PTS) and how their sponsorship works now, and Philippe wondered whether TPRF could be helpful in managing some of the complexity of that. Rik said “very likely!” and suggested Philippe talk to them.

Response header name ' Content- type' contains invalid characters, after running a Perl_CGI script.

Hello ! Everyone, I am back here again to get your help.
Sorry, sorry for getting help alone and not helping other people's post.
But I will try to help others in another way, so please generous.
O.K. let me get started. I got weird error message as shown at the title, while I am reviewing the error_log at /var/log/httpd/ error_log. I never encountered this error message, so I can't figure the point of the error message. Does anyone has any clue to fix this error?

Perl Weekly Challenge 261: Element Digit Sum

These are some answers to the Week 261, Task 1, of the Perl Weekly Challenge organized by Mohammad S. Anwar.

Spoiler Alert: This weekly challenge deadline is due in a couple of days from now (on March 24, 2024 at 23:59). This blog post provides some solutions to this challenge. Please don’t read on if you intend to complete the challenge on your own.

Task 1: Element Digit Sum

You are given an array of integers, @ints.

Write a script to evaluate the absolute difference between element and digit sum of the given array.

Example 1

Input: @ints = (1,2,3,45)
Output: 36

Element Sum: 1 + 2 + 3 + 45 = 51
Digit Sum: 1 + 2 + 3 + 4 + 5 = 15
Absolute Difference: | 51 - 15 | = 36

Example 2

Cloud Provider Performance & Price Comparison 2023

CloudB.png

Last year I compared the various VM types of 7 popular cloud providers mainly for Perl performance, as I was looking at workloads that we'd be using at SpareRoom - you can see that comparison here.

This year I expanded the comparison to 10 providers, and while I posted it on dev.to, I thought I'd give a heads up to blogs.perl readers, especially to the commenters of the last years' post that had suggestions I incorporated.

TPRC Hackathon 2023

perl raku hackathon.png

The Perl and Raku Conference for 2023 will again feature a Hackathon Room. On July 10th, the Marketing Committee plans to coordinate activities for projects that have a broad impact on Perl.

We hope to involve 2-3 high impact projects and any number of smaller projects.

The committee will provide logistical and non-coding support for projects that want it. We want to help by:
  • matching people to projects and projects to people
  • keeping a record of commits and achievements for a post-event blog post
  • answer other questions like "where are bathrooms?" and "what is the wifi password?"
  • print and hang some pretty signs
  • manage the #hackathons2023 slack channel

Interested projects please comment on this post or contact us using marketing(at)perlfoundation(dot)org

Please note that anyone is welcome to use the room to hack on their project and to solicit help for it subject to the Conference SoC. This room is available on both the day before and the day after the conference. The wiki page for the Hackathon room is here

Perl Weekly Challenge #216 - Choosing a Nickname for Your Car

Hi everybody!

Just one solution to the first task in the weekly challenge this week, and it's a different type. I didn't have time to do any more, and this solution might not be the most efficient or cleanest, but it looks reasonably good to me.

The goal is to find any words which contain all the letters of the car registration number. I assume this would be to find a nickname for your car based on its registration number. In the examples, all of the words are lower-case, so I just assume that my inputs are lower-case. This week I used a few language features that I haven't used in previous challenges, like loop labels, POSIX classes, and a variable regex. As usual, the first argument to the script (without the space in the rego in the examples) is the registration and the rest of the arguments are the words to match it to.

Here's the code: #!/usr/bin/perl

Perl Weekly Challenge 258: Sum of Values

These are some answers to the Week 258, Task 2, of the Perl Weekly Challenge organized by Mohammad S. Anwar.

Spoiler Alert: This weekly challenge deadline is due in a couple of days from now (on March 3, 2024 at 23:59). This blog post provides some solutions to this challenge. Please don’t read on if you intend to complete the challenge on your own.

Task 2: Sum of Values

You are given an array of integers, @int and an integer $k.

Write a script to find the sum of values whose index binary representation has exactly $k number of 1-bit set.

Example 1

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.