Perl Weekly Challenge 231: Min Max

These are some answers to the Week 231, 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 August 27, 2023 at 23:59). This blog post offers some solutions to this challenge. Please don’t read on if you intend to complete the challenge on your own.

Task 1: Min Max

You are given an array of distinct integers.

Write a script to find all elements that is neither minimum nor maximum. Return -1 if you can’t.

Example 1

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

The minimum is 1 and maximum is 4 in the given array. So (3, 2) is neither min nor max.

Example 2

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

Example 3

TWC 193: Evens and Oddballs

In which we revisit seventh grade, and sing in the key of "A".

This week in PSC (089) | 2022-12-02

Back to the full three of us. Not much needed looking at this week.

  • Posted the smartmatch deprecation message to p5p@; will post it to blogs etc.. after a round of responses.
  • Sent off a reminder that we're looking for help or a project manager on getting SSL support out of the box.
  • Reviewed the RFC tracker and found some that are ready to implement but not nobody has started; they are nearing their expiry time. These are:
    • ${^ENGLISH_NAME} aliases for punctuation variables
    • Optional chaining
    • Drop support for ' as package name separator
    • Template Strings (qt)

Making GitHub CI work with Perl 5.8.

A while back. I got a pull request from Gabor Szabo adding a GitHub action to one of my distributions. I have been working with this, but have not (so far) blogged about it because, quite frankly, I am still not sure I know what I am doing.

One of my personal desires was to test my distributions on the oldest practicable Perl for each available architecture. For Unix (i.e. Linux and macOS) this is 5.8.8, provided the distribution itself supports that. A couple days ago, though, I pushed a modification to one of my distributions and had the 5.8.8 tests blow up.

The problem turned out to be that Module::Build, for reasons I have not investigated, has Pod::Man as a dependency. The current version of Module::Build requires Pod::Man version 2.17, but according to corelist Perl 5.8.8 comes with Pod::Man version 1.37, so cpanm wants to upgrade it.

Perl Weekly Challenge 230: Count Words

These are some answers to the Week 230, 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 August 20, 2023 at 23:59). This blog post offers some solutions to this challenge. Please don’t read on if you intend to complete the challenge on your own.

Task 2: Count Words

You are given an array of words made up of alphabetic characters and a prefix.

Write a script to return the count of words that starts with the given prefix.

Example 1

Input: @words  = ("pay", "attention", "practice", "attend")
       $prefix = "at"
Ouput: 2

Two words "attention" and "attend" starts with the given prefix "at".

Example 2

German Perl/Raku Workshop 2023 Call for Papers

The German Perl/Raku Workshop takes place from February 27 to March 1st 2023 in Frankfurt/Main, Germany.

We are looking for your contribution in the form a talk (20 minutes or 40 minutes), a lighting talk (5 minutes) or a workshop (2-4 hours). Please submit your proposals using this online form.

The theme in 2023 is Perl Futures - of course the two developments of Perl, Raku and Perl as well as the reference to the financial metropolis Frankfurt am Main. Presentations with these emphases are especially sought after, but all contributions on Perl, Raku and software development in general are welcome.

Read the complete Call for Papers

New feature: HTTPS support

The site is now served over HTTPS.

TWC 192: Frosting a cake without flipping the spatula

In which we refine and refactor past the point of recognition:

(  [\+] ( @a X- target )  )».abs.sum

In Raku, Perl, and Rust.

Perl Weekly Challenge 230: Separate Digits

These are some answers to the Week 230, 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 August 20, 2023 at 23:59). This blog post offers some solutions to this challenge. Please don’t read on if you intend to complete the challenge on your own.

Task 1: Separate Digits

You are given an array of positive integers.

Write a script to separate the given array into single digits.

Example 1

Input: @ints = (1, 34, 5, 6)
Output: (1, 3, 4, 5, 6)

Example 2

Input: @ints = (1, 24, 51, 60)
Output: (1, 2, 4, 5, 1, 6, 0

This task is very simple. We just need to split each value of the input array into individual digits and collect them into a list or an array.

Separate Digits in Raku

An objective criteria for deprecating community platforms

Perl has been around for a couple of years longer than Python and Linux. Perl 5 was released in 1993, the same year as FreeBSD and NetBSD.

In the 90's for Open Source projects the "community platforms" where Usenet newsgroups and mailing lists run on Listserv or Majordomo (Mailman didn't show up until 1999). IRC was used for text based chat but without SSL!. CVS was the open source version control system of choice or you might have been unlucky enough to use Visual Source Safe at work, whilst Subversion wouldn't show up until 2000.

But the 90's are more than 20 years in the past and IPv6 is actually seeing meaningful adoption now. Many of the above technologies are as completely foreign to people with 10+ years of industry experience as Compact Cassettes, VHS, LaserDisc and maybe CDs or even DVDs.

As people have embraced Git and even now IPv6 - we too can and must embrace newer platforms that offer a better experience for us humans as we work together on Perl related projects.

Kephra: Select All

To continue my previous post about Kephra, please let me ramble about just one seemingly little feature. It is interesting in its own right - but also an example for the design principles I employ:

1. max productivity

2. max consistency (less to memorize)

3. breaking habits and customs only when 1 and 2 demand it.

As soon graphics plays a greater role I will add max beauty as new 2.

This week in PSC (088) | 2022-11-25

A smaller-than-usual meeting because of the US Holiday; only Paul and Philippe today.

  • We remembered we still need to write the announcement for deprecating smartmatch
  • We need to resync with Neil about how "SSL in Core" investigations are going
  • Reviewed RFCs and found a shortlist of "soon to expire" ones. A nudge email will be sent to the RFC sponsors.

Perl Weekly Challenge 229: Two out of Three

These are some answers to the Week 229, 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 August 13, 2023 at 23:59). This blog post offers some solutions to this challenge. Please don’t read on if you intend to complete the challenge on your own.

Task 2: Two out of Three

You are given three array of integers.

Write a script to return all the elements that are present in at least 2 out of 3 given arrays.

Example 1

Input: @array1 = (1, 1, 2, 4)
       @array2 = (2, 4)
       @array3 = (4)
Ouput: (2, 4)

Example 2

Live streaming the release of Perl 5.37.6

Just like last year, I'm doing a dev release of Perl, this time version 5.37.6. And again
like last year, you can watch it live on Sunday 20th of November on Twitch:

You can expect to watch me talk through the steps of the Perl
Release Managers Guide and if you join the Twitch chat, or
#p5p on irc.perl.org, we can chat a bit.

I assume I'll start Sunday at 09:00 UTC (11:00 CET), and the whole thing will
take around 4 hours unless there are some major mishaps.

Perl performance evolution over the last decade

I was reading recently about some significant Python 3.11 performance improvements, and I was wondering whether Perl 5 still gets significant performance improvements on each version - even though it might be more mature, thus more optimized in the first place.

I thought I'd compare the final releases of alternating versions starting with 5.12.5 released 10 years ago, using a benchmark I made for a cloud vm comparison. As is the case with any benchmark, it might not be representative of your own workloads - it benchmarks things that are relevant to me and also some things that I would avoid, but are used by many modules and are notoriously slow (mainly DateTime and Moose). However, it is more representative of "real-life", with results that are not lost in noise, than say, PerlBench (which has a different purpose of course). 
Here is the list of the tested Perl releases:

This week in PSC (086) | 2022-11-11

We're trying out new ways to send out these regular announcements of what we get up to on the Perl Steering Council. This will be a regular posting that gives a brief summary of what we discussed in our weekly (or at least, near-weekly, give or take scheduling clashes) meetings.

  • Internals docs (such as perlguts, perlapi) could be done better, but it's unclear how. Some new documents might be useful, but there's a risk of spending too much time on obscure internal specifics that almost nobody will ever need to read about or touch.
  • Smartmatch deprecation continues. Philippe has sent patches to CPAN modules that may be affected. autodie still needs some further work.
  • (As alluded to by this very blog post) we discussed communication strategies for user-facing news announcements. Thoughts are to post here on blogs.perl.org and send links elsewhere - such as Twitter, Reddit, etc.. We don't have a good feel for where folks will find it, so we'll just have to adapt as we go.
  • The module_true branch which implements the RFC is now merged and will be default in use v5.38. This will mean you no longer need to remember that final 1; line at the end of your module file.

Perl Weekly Challenge 229: Lexicographic Order

These are some answers to the Week 229, 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 August 13, 2023 at 23:59). This blog post offers some solutions to this challenge. Please don’t read on if you intend to complete the challenge on your own.

Task 1: Lexicographic Order

You are given an array of strings.

Write a script to delete element which is not lexicographically sorted (forwards or backwards) and return the count of deletions.

Example 1

Input: @str = ("abc", "bce", "cae")
Output: 1

In the given array "cae" is the only element which is not lexicographically sorted.

Example 2

Return of Kephra

Juhuu, released Kephra 0.401 in the spirit release early - release often. It is the start of a complete rewrite. So it's back to zero: now it can only edit one file at a time and has only Perl highlighting and UTF-8 or ASCII encoding. But some of you will still want to use it (beside vi, emacs, VStudio or atom - I know) because of the comfort in basic editing it provides. The following article explains what I mean by that.

I start to post the entries of "Python/numpy porting to Perl" in DEV Community

I start to post the entries of "Python/numpy porting to Perl" in DEV Community.

Yuki Kimoto - DEV Community.

This week in PSC (087) | 2022-11-18

  • We briefly discussed conversion from C89 to C99. We think it's not really worth updating old code proactively, but definitely writing new code in modern style. If significant changes are being made within a function it might be worth updating the entire function to C99, but otherwise don't bother doing huge sweeping changes to entire files.
  • We talked about announcing the deprecation of smartmatch. We will work on wording for a new post and send that out soon, outlining our current plans.
  • Paul has a (draft) PR to add pluggable infix operators, but it still needs more additions before it's considered core-worthy

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.