This week in PSC (138) | 2024-02-28

Back to the usual three of us

  • Further chats on allowing a subsequent use VERSION of the same value as is already prevailing

  • We continued going through the bug list to tag release blockers

Perl Weekly Challenge 273: B After A

These are some answers to the Week 273, 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 June 16, 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: B After A

You are given a string, $str.

Write a script to return true if there is at least one b, and no a appears after the first b.

Example 1

Input: $str = "aabb"
Output: true

Example 2

Input: $str = "abab"
Output: false

Example 3

Input: $str = "aaa"
Output: false

Perl & Raku Conference 2024 to Host a Science Track!

I am very pleased to announce that the 2024 Perl & Raku Conference Planning Committee (TPRC) is moving forward with the addition of a new track that targets academic, governmental, and industrial STEM applications. It will strive to be organized as a traditional science conference track; meaning the talks will be based on paper and poster submissions. (more on this in a future announcement!)

The decision by the TPRC Planning Committee is the result of an overwhelmingly positive response to the Science Track Survey that was held late in 2023. Everyone involved in organizing the survey deeply appreciates those who filled out the survey or shared it with others.

The track is being organized in tight cooperation with the TPRC, by the Science Perl Committee (SPC); a separately organized group of Perl and STEM enthusiasts that anyone of good will is welcome to join.

What to expect now: ...

My 2023 in Perl

2023 was a rather productive year for me on CPAN. Aided by taking some time off I managed to release a whopping 18 new modules.

Passwords

Half of my new modules were related to my password framework Crypt::Passphrase. To be honest most of them are either small (± 100 LOC) glue two or three other pieces of code together. And then there was Crypt::HSM, a PKCS11 interface (to use cryptographic hardware without exposing cryptographic keys) that was probably more work (2600 LOC of XS) than the others combined.

Most of this was with the aim to add peppering support to Crypt::Passphrase, a subject extensive enough that I should probably dedicate a separate blogpost to it.

This week in PSC (137) | 2024-02-22

Paul was away this week.

  • we talked about the hiccups that PAUSE seems to have been through
  • we discussed further changes to the use VERSION behaviour (warnings)
  • and we started going through the bug list to tag release blockers

Perl Weekly Challenge 253: Split Strings

These are some answers to the Week 253, 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 January 28, 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: Split Strings

You are given an array of strings and a character separator.

Write a script to return all words separated by the given character excluding empty string.

Example 1

Input: @words = ("one.two.three","four.five","six")
       $separator = "."
Output: "one","two","three","four","five","six"

Example 2

Input: @words = ("$perl$$", "$$raku$")
       $separator = "$"
Output: "perl","raku"

Split Strings in Raku

Live streaming the release of Perl 5.39.7

I missed last year but in 2024 I'm doing a dev release of Perl again. This time it is version 5.39.7.
And again, you can watch it live on Saturday 20th of January on Twitch.

Never matching: everybody is doing it wrong

Well, not actually wrong, just slow. But the exaggeration makes a punchier headline, you’ll admit.

This comes up when an interface takes a pattern to match things against. Sometimes you have some reason to want this match to always fail, so you want to pass a pattern which will never match. The customary way of doing this is to pass qr/(?!)/. There is a problem with that, though.

I’m not talking here about the fact that if possible, you really don’t want to pass an actual qr object. We’ve already covered that. It was a surprising enough discovery that I’ll take this opportunity to signal-boost that while we’re here, but this article is not about that.

This week in PSC (136) | 2024-02-15

  • working out a timeline of what should go in to 5.39.8, 5.39.9, and what to defer to 5.41
  • draft tests+docs received from Martijn Lievaart (“M4”) for a logical xor (^^) operator
  • the responses saying no to adding Data::Printer in core that it doesn’t seem like it would be popular
  • some potential new sprintf format templates:
    • a float template that produces the shortest string that represents the exact float (similar to what Math::Ryu does),
    • a %q to access B::perlstring/quotemeta or something similar
  • the realisation that, some months ago, Mark Gardner had volunteered to work on the SSL-in-core project, and we haven’t heard from them since.

Step Counter (Advent of Code 2023/21)

The Task

We’re given a grid with obstacles, we’re supposed to count all the reachable plots in the grid in a given number of steps (we can only move one plot at a time horizontally or vertically).

The sample input looks like this:

...........
.....###.#.
.###.##..#.
..#.#...#..
....#.#....
.##..S####.
.##..#...#.
.......##..
.##.#.####.
.##..##.##.
...........

where S is the starting position.

Perl Weekly Challenge 248: Submatrix Sum

These are some answers to the Week 248, 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 December 24, 2023, 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: Submatrix Sum

You are given a NxM matrix A of integers.

Write a script to construct a (N-1)x(M-1) matrix B having elements that are the sum over the 2x2 submatrices of A,

b[i,k] = a[i,k] + a[i,k+1] + a[i+1,k] + a[i+1,k+1]

Example 1

Migrating from DBD::mysql to DBD::MariaDB

DBD::mysql has long provided the interface to connect to the MySQL database from Perl code. But as old as it is, it was implemented with some critical bugs that cannot simply be corrected without breaking mountains of existing code relying on those bugs. For this same reason, though DBD::MariaDB corrects these bugs, care must be taken when migrating existing code to avoid subtle breakage.

This blog post is far too short to explain Unicode and encodings like UTF-8; for anyone seeking a more solid grasp on the concepts, I recommend a read through The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!) by Joel Spolsky.

This week in PSC (134) | 2024-02-01

All three of us returned.

We only had one issue to discuss, the pressing matter of how to handle lexical unimports, builtin version bundles, the integration with use VERSION, and various related topics.

It’s complicated. We’ve been putting together a longer mail on the subject and that will come out as its own thread soon.

Brain Memory Management

My next dev article about the important concept of cognitive load of code and how to manage it.

Perl Weekly Challenge 273: Percentage of Character

These are some answers to the Week 273, 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 16, 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: Percentage of Character

You are given a string, $str and a character $char.

Write a script to return the percentage, nearest whole, of given character in the given string.

Example 1

Input: $str = "perl", $char = "e"
Output: 25

Example 2

Input: $str = "java", $char = "a"
Output: 50

Example 3

Input: $str = "python", $char = "m"
Output: 0

Example 4

It's the Twelve Days of Dancer, 2023 edition!

The 2023 Dancer Advent Calendar, the Twelve Days of Dancer is up and running! We hope you'll enjoy this year's version - there's a lot of fun and practical gifts to be found there.

Hot on the heels of our earlier gift (Dancer2 1.1.0) come two more plugin releases, Dancer2::Plugin::Cache::CHI and Dancer2::Plugin::Syntax::GetPost.

Enjoy! Let us know what you think. Happy holidays to all! (and now it is time for this Dancer to enjoy a long winter's nap)

Jason/CromeDome

This week in PSC (127) | 2023-12-07

This week we:

  • Worked out final resolving actions for security issues.
  • Discussed recent mailing-list posts about making method non-public by default. This probably won’t work but we could open a PPC discussion on my method + $obj->&method syntax.
  • Reviewed Projects in Flight - posted below
  • Merged the PR for PPC 0022 (Metaprogramming API). Discussions on individual points can be made using GH Issues

Projects in Flight

  • HTTPS out of the box — (Paul) has nudged Mark Gardner by email
  • PPC 0013 overload in join — (Philippe) should open an issue with his thoughts on the topic
  • PPC 0014 English names — (Paul) should check in with Joe McMahon
  • PPC 0019 qt Strings — (Paul) now has TPF Core Development Grant so can start writing this Any Day Now(TM)
  • PPC 0021 Optional chaining — (Paul) should check in with Veesh Goldman
  • PPC 0022 Metaprogramming API — (Paul) has a CPAN module, would be nice if anyone started using it for any reason
  • (Graham) to write a PPC for ->&
  • Perl roadmap for 2024 — Yeah it’d be nice if we had one, but without having any weight of promise behind it it’s just words
  • TODDR to write a draft pod/security_disclosure_process.pod (not in December), and also offered to coordinate the next incident

Is Perl a write only language?

I am sick and tired of hearing this, so let's put it this to the test. Assume you know little of Perl, or any programming language for that matter. Can you parse the code?

https://chrisarg.github.io/Killing-It-with-PERL/2023/12/06/Is-Perl-a-write-only-language.html

I hope the piece above is the first in a series to convince people to consider the reality before passing judgement. It was inspired by one of our research analysts discovering Perl and awk to simplify their lives when cleaning data.

Perl Weekly Challenge 272: String Score

These are some answers to the Week 272, 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 June 9, 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: String Score

You are given a string, $str.

Write a script to return the score of the given string.

The score of a string is defined as the sum of the absolute difference between the ASCII values of adjacent characters.

Example 1

Cosmoshop unterstützt den Deutschen Perl/Raku-Workshop

We are happy to announce that CosmoShop supports the German Perl/Raku-Workshop.

CosmoShop is the largest pure Perl based shop system.

Since 1997, we have been implementing sophisticated and individual eCommerce projects in the B2B sector with our specially developed store software. We are the central point of contact for the entire spectrum.

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.