This week in PSC (156) | 2024-08-15

Just Graham and Aristotle this time.

  • Discussed some patches to include in a perl 5.38 or 5.40 point release.
  • We will be watching the fallout from the removal of apostrophe as package separator.
  • Discussed what could be done for lexical method calls.

[P5P posting of this summary]

Perl Weekly Challenge 285: Making Change

These are some answers to the Week 285, 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 September 8, 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: Making Change

Compute the number of ways to make change for given amount in cents. By using the coins e.g. Penny, Nickel, Dime, Quarter and Half-dollar, in how many distinct ways can the total value equal to the given amount? Order of coin selection does not matter.

A penny (P) is equal to 1 cent.
A nickel (N) is equal to 5 cents.
A dime (D) is equal to 10 cents.
A quarter (Q) is equal to 25 cents.
A half-dollar (HD) is equal to 50 cents.

Sailing the Seven YAPCs


[This is my seventh YAPC / TPC.  If you like, you can read about my other YAPC experiences: YAPC 2011, YAPC 2013, YAPC 2014, YAPC 2015, YAPC 2016, YAPC 2018.]


Well, after taking a very long break inspired (to understate it a bit) by the pandemic, I’m back to attending in-person Perl events with my seventh YAPC.  Or, The Perl Conference, I suppose, but it still feels like YAPC to me.  As per usual, here are some reflections.

Repository of examples using Perl and Assembly together

Sometimes one needs an extra ounce of performance. Why not combine the high level semantics of Perl with the punch of assembly?

This repo includes various examples of how this can be done.

This week in PSC (155) | 2024-08-08

Just Graham and Aristotle this time.

  • Discussed tracking perl authorized releasers updates and storing historical data
  • Dual-Life modules need some cleanup to get a more normal release process that can be done more regularly. Cleanup has been done on Storable.
  • Time::HiRes by default doesn’t seem terrible, if possible
  • X509 in core could make sense as part of a more complete interface to OpenSSL
  • Discussion about how it would be possible to have support for Markdown or other new Pod extensions in a more backwards compatible way. Possibly a way to define alternate formats for =begin/=end sections.

[P5P posting of this summary]

Today I learned... #1: variable scoping in if-else blocks

This block of code is valid Perl:

if (my $var1 = calc1()) {
    say $var1;
} elsif (my $var2 = calc2()) {
    say "$var1, $var2";
}

As you can see, $var1, which is declared in the if clause, is visible inside the elsif clause too.

Perl never ceases to amaze me!

(Also appears in my blog)

Perl Weekly Challenge 276: Complete Day

These are some answers to the Week 276, 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 July 7, 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: Complete Day

You are given an array of integers, @hours.

Write a script to return the number of pairs that forms a complete day.

A complete day is defined as a time duration that is an exact multiple of 24 hours.

Example 1

Input: @hours = (12, 12, 30, 24, 24)
Output: 2

Pair 1: (12, 12)
Pair 2: (24, 24)

Example 2

Parallel Perl/C applications without tears using OpenMP: Controlling the OpenMP environment

Brett Estrade, did it again with yet another excellent talk at TPRC 2024 about the use of OpenMP for parallelizing Perl/C code. This is an area that is extremely interesting as OpenMP is a rather straightforward way to parallelize code using simple compiler pragmas in Inline::C sections of code. Furthermore, as I discussed at TPRC2024, the combination of the Many Core Engine (MCE) and OpenMP allow the Perl user to endow a specific piece of code with both process and thread level parallelism, bleeding the hardware for performance without losing the benefits of Perl for high level coding.

Since this an area that may not be familiar to many users, I decided to start blogging about Perl/C parallel application programming at Killing It With Perl . The first post in this series is about a rudimentary control of the OpenMP environment , e.g. setting up the number and scheduling of the threads and you can read all about it here.

This week in PSC (154) | 2024-08-01

This week, the whole PSC was in attendance.

We merged HTTP-Tiny#6, and then discussed a number of topics:

  • some improvements on the process for releasing blead-upstream dual-life modules are needed
  • the instructions for releasing a new Perl are difficult to follow and partly redundant, the process takes longer than it should, and more of it could be automated
  • the pumpkin permission list has grown over time, and probably needs to be trimmed
  • more talk about Markdown documentation
  • thoughts on how to strike a better balance with the verbosity/brevity of meeting minutes

Justifying Embarrassing Errors.

I remember when one one of my grandchildren helpfully decided reorganise a bookshelf whilst by himself. Upon being discovered, sitting in front of an empty shelf with books strewn all around him, his instinctive reaction made me feel proud to be his grandpa. He looked up and said, “Oh dear! Oh dear! what happened?”, as if this calamity had occurred spontaneously, astonishing him as much as the angry parent who was going to have to tidy it all up. It is hard to hide amusement when you watch your kids have to deal with their kids.

Advanced Disaster Management Strategy for Grandchildren and Programmers

What's new in Perl v5.40?

Here I share my personal favourite core enhancements in Perl v5.40.

https://theweeklychallenge.org/blog/what-is-new-in-perl

Perl Weekly Challenge 274: Goat Latin

These are some answers to the Week 274, 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 June 23, 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: Goat Latin

You are given a sentence, $sentance.

Write a script to convert the given sentence to Goat Latin, a made up language similar to Pig Latin.

Rules for Goat Latin:

1) If a word begins with a vowel ("a", "e", "i", "o", "u"), append "ma" to the end of the word. 2) If a word begins with consonant i.e. not a vowel, remove first letter and append it to the end then add "ma". 3) Add letter "a" to the end of first word in the sentence, "aa" to the second word, etc etc.

Example 1

This week in PSC (153) | 2024-07-25

After over a month without a PSC meeting, this was the first meeting of the new, shiny PSC. Today, we:

  • welcomed Aristotle, and said goodbye to Paul
  • discussed the current projects in flight, the PPC process and the onboarding tasks (preparing for next year already!)
  • talked about POD, docstrings, and the Perl release process

Neuigkeiten: OTOBO 11 Veröffentlicht

Wir freuen uns, die Veröffentlichung von OTOBO 11 bekannt zu geben! Die neueste Version der beliebten Open-Source-Ticketsystem-Software bringt zahlreiche Verbesserungen und neue Funktionen mit sich. Erfahren Sie mehr über die neuen Features und Änderungen auf OTOBO

Making time to waste.

Over the years that I have existed in four dimensions, I have come to accept that time is not a linear concept heading inexorably in one direction at a uniform rate. It didn't take an Einstein or Hawking to convince me either. Time is as malleable as the distortions applied by our consciousness, or imposed by those around us. Consider my youngest daughter's essay due to be handed in on Tuesday, a task assigned 4 months earlier. At 4,000 words, it represented roughly 6 words an hour allowing for eating, sleeping, work, weekend fun, and other essential time-devouring activities. Yet the "I have got plennnnty of time, chill, dad!" of a few months ago, has now turned into cries of despair, as she has to do an all nighter at her desk instead of being at some selfie-rich event critical to her mental well-being and social standing.

Perl Weekly Challenge 284: Relative Sort

These are some answers to the Week 284, 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 September 1, 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: Relative Sort

You are given two list of integers, @list1 and @list2. The elements in the @list2 are distinct and also in the @list1.

Write a script to sort the elements in the @list1 such that the relative order of items in @list1 is same as in the @list2. Elements that is missing in @list2 should be placed at the end of @list1 in ascending order.

Example 1

Input: @list1 = (2, 3, 9, 3, 1, 4, 6, 7, 2, 8, 5)
       @list2 = (2, 1, 4, 3, 5, 6)
Ouput: (2, 2, 1, 4, 3, 3, 5, 6, 7, 8, 9)

Example 2

This week in PSC (151) | 2024-06-13

Graham and Philippe met briefly today.

Now that Perl 5.40 is out, and the nomination process for the next PSC is underway, there wasn’t much to discuss, so we cut the meeting short.

Equalise an Array

The Weekly Challenge 270/2

In the week 270, the second task was really interesting and difficult. Here’s a slightly reformulated version:

We’re given an array of positive integers @ints and two additional integers, $x and $y. We can apply any sequence of the following two operations: 1. Increment one element of @ints. 2. Increment two elements of @ints. The cost of each application of operation 1 is $x, the cost of operation 2 is $y. What’s the minimal cost of a sequence of operations that makes all the elements of @ints equal?

Why do I say it was difficult? I compared all the Perl and Raku solutions I could find in the GitHub repository and none of them gave the same results as mine. It took me several days to find an algorithm that would answer the tricky inputs I generated with a pen and paper, and one more day to optimise it to find the solutions in a reasonable time.

Perl Toolchain Summit 2024 in Lisbon

Last year at the Perl Toolchain Summit (PTS) in Lyon, I left three draft pull requests: one about the class declaration introduced in Perl 5.37, one about the PAUSE on docker, and one about multifactor authentication. I wanted to brush them up and ask Andreas König to merge some, but which should I prioritize this year?

Perl Weekly Challenge 284: Lucky Integer

These are some answers to the Week 284, 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 September 1, 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: Lucky Integer

You are given an array of integers, @ints.

Write a script to find the lucky integer if found otherwise return -1. If there are more than one then return the largest.

A lucky integer is an integer that has a frequency in the array equal to its value.

Example 1

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

Example 2

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

Example 3

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.