This week in PSC (162) | 2024-10-03

Everyone was present this week.

  • We devised a strategy to deal with smartmatch, starting with reverting its removal. A separate email with details will follow.
  • We spent too much time talking about putting the apostrophe package separator behind a feature. That too will be outlined in a separate email. A github issue will follow.
  • We want to revert the open undef patch, for a variety of reasons, such as breaking autodie. We decided the steps to handle this.

[P5P posting of this summary]

Perl Weekly Challenge 287: Valid Number

These are some answers to the Week 287, 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 22, 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: Valid Number

You are given a string, $str.

Write a script to find if it is a valid number.

Conditions for a valid number:

- An integer number followed by an optional exponent.
- A decimal number followed by an optional exponent.
- An integer number is defined with an optional sign '-' or '+' followed by digits.

Decimal Number:

A decimal number is defined with an optional sign '-' or '+' followed by one of the following definitions: - Digits followed by a dot '.'. - Digits followed by a dot '.' followed by digits. - A dot '.' followed by digits.

Exponent:

Perl wiki updated, 4 other wikis uploaded - Take 2

Hi All

Note: The first 3 links point to my personal page

The Perl wiki has been renamed from Perl.html - which was too generic - to Perl.Wiki.html:

The Mojolicious wiki is at:

The Debian wiki is at:

Note: The next 2 links point to my new website which accompanies my upcoming Youtube channel

The Symbolic Language wiki is at:

The Personal Security wiki is at:
https://symboliciq.au/misc/Personal.Security.Wiki.html

London Perl & Raku Workshop 2024 Schedule Now Available

The schedule for this year's London Perl & Raku Workshop is now visible: https://act.yapc.eu/lpw2024/schedule. Please please please (please please) make a point to mark those talks that you plan to attend as this will allow us to tweak the schedule a bit if some talks are more heavily favourited than others.

The venue opens for attendees at 9am and we plan to start talks at 9:30am. Drinks will be available throughout the day, hence no need to have dedicated breaks there. Lunch will be at midday for an hour, there are plenty of options close to the venue to grab something to eat. If we receive a couple more sponsors we can have lunch at the venue, but currently that won't be possible.

There are a couple of spots left for talks, otherwise the schedule is full. Please don't let this put you off submitting a talk as it's possible some speakers may have to change their plan.

This week in PSC (161) | 2024-09-27

We were all present this week:

  • We rehashed the Perl version number discussion from last meeting now that we are all present. We will put together a document with our thoughts on this.
  • We will create a GitHub issue to make apostrophe removal feature-guarded.
  • Smartmatch (not so surprisingly) turns out to be too big to fail. Given its unique history, we are considering options for how to proceed with it in a more gradual way without giving up on the deprecation.
  • Regarding open undef (GH #22490), we agreed that Perl should support undef as a value and not just as a literal for the filename (and warn for the useless modes)

[P5P posting of this summary]

Perl Weekly Challenge 285: No Connection

These are some answers to the Week 285, 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 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 1: No Connection

You are given a list of routes, @routes.

Write a script to find the destination with no further outgoing connection.

Example 1

Input: @routes = (["B","C"], ["D","B"], ["C","A"])
Output: "A"

"D" -> "B" -> "C" -> "A".
"B" -> "C" -> "A".
"C" -> "A".
"A".

Why does this not work

Why does this not give flinstone and rubble?

$fn{"fred"} = "flintstone";
$fn{"barney"} = "rubble";
foreach $per (qw< barney fred >) {
print " he's $per $fn($per).\n";
}

First Batch of LPW 2024 Talks Accepted

Yep, that's right - the first dozen talks have been accepted for this year's London Perl and Raku Workshop. This puts our schedule at approximately 50% full, so if you are thinking about talking at the workshop then submit your proposal now!

If you aren't thinking about talking then have a think about what you've been doing in the Perl and/or Raku space the last five years, or even just the general IT and development space. Perhaps there's something interesting you can talk about? If you don't feel it's a full fat talk then submit a lightning talk instead.

The London Perl and Raku Workshop will take place on 26th Oct 2024. Thanks to this year's sponsors, without whom LPW would not happen:

If you would like to sponsor LPW then please have a look at the options here: https://act.yapc.eu/lpw2024/sponsoring.html

This week in PSC (160) | 2024-09-12

Just Aristotle and Graham.

The notes from this meeting were lost, but have been reconstructed from memory.

  • We had a discussion about what future versioning (Perl 7) should look like.
  • Discussed if we will need to make changes to apostrophe as package separator, and smartmatch removal, given the fallout they have had.

[P5P posting of this summary]

Perl Weekly Challenge 287: Strong Password

These are some answers to the Week 287, 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 22, 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: Strong Password

You are given a string, $str.

Write a program to return the minimum number of steps required to make the given string very strong password. If it is already strong then return 0.

Criteria:

- It must have at least 6 characters.
- It must contain at least one lowercase letter, at least one upper case letter and at least one digit.
- It shouldn't contain 3 repeating characters in a row.

Following can be considered as one step:

How I use PostgreSQL's timestamptz fields in my Mojo apps

I created a function in Perl called pg_dt, that will convert PostgreSQL’s datetime values into Perl’s DateTime values and vice versa. This is useful both when you want to store DateTime values into the database, or want to convert the pg datetime/timestamp value from the database into a DateTime object value that Perl can use.

I really can’t seem to include code blocks in my posts on this platform (tried Preview with Markdown and Markdown With SmartyPants without success), so you can read the rest of this article on my blog.

Updated, curated, Perl module TiddlyWiki

Download the Perl TiddlyWiki

Read about TiddlyWIkis

Cheers

Dancer2 1.1.1 Released

The Dancer Core Team is happy to announce that Dancer2 1.1.1 is on its way to CPAN. This is a maintenance release that deals with the following issues:

[ BUG FIXES ]
* GH #1712: Fix use of send_as in templates (Andy Beverley)

[ DOCUMENTATION ]
* PR #1706: Document missing logging hooks and log format option;
  fix typo in logging test (Jason A. Crome)

Happy Dancing! Jason / CromeDome

Perl Weekly Challenge 286: Order Game

These are some answers to the Week 286, 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 15, 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: Order Game

You are given an array of integers, @ints, whose length is a power of 2.

Write a script to play the order game (min and max) and return the last element.

Example 1

TWC 277: Strength Uncombined

In which thousands become millions, as we achieve a near-linear solution.

How to use perl v5.40's boolean builtins in Mojo::Pg queries

Perl v5.40 introduced native true and false keywords. Unfortunately not all CPAN modules are ready to use them. One of those not yet ready is Mojo::Pg.

Normally you'd want to pass booleans to your queries as just 1's and 0's. However, since Mojo::JSON's true & false stringify to 1 and 0, my 5.38-using codebase is full of Mojo::Pg queries with Mojo::JSON's true and false as arguments.

This is a problem if I want to upgrade the perl interpreter of that project to Perl v5.40, because if I write "use v5.40;" in the file that contains those boolean keywords, Perl's builtin booleans will be used instead, which don't stringify to 1 and 0, but to 1 and the empty string, which can't be used by DBD::Pg in boolean fields and makes DBD::Pg throw an exception.

The solution I found was to subclass Mojo::Pg::Database, and wrap the query method, so that if Perl's builtin booleans are found, they are replaced in the query with native Pg booleans.

The source of the module and a lot more information can be found in my blogpost, here.

Using Coro and AnyEvent Interactively

Problem

I have not been able to figure out how to run an async thread in the background while using a REPL like reply. The moment I run the main loop, it takes over the input from the REPL. Here's what a typical failed REPL session might look like.

Perl Weekly Challenge 286: Self Spammer

These are some answers to the Week 286, 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 15, 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: Self Spammer

Write a program which outputs one word of its own script / source code at random. A word is anything between whitespace, including symbols.

Example 1

If the source code contains a line such as: 'open my $fh, "<", "ch-1.pl" or die;'
then the program would output each of the words { open, my, $fh,, "<",, "ch-1.pl", or, die; }
(along with other words in the source) with some positive probability.

Example 2

Technically 'print(" hello ");' is *not* an example program, because it does not
assign positive probability to the other two words in the script.
It will never display print(" or ");

Example 3

This week in PSC (159) | 2024-09-05

All present, and this time the meeting actually ended on time.

  • We discussed the situation with the apostrophe package separator removal. We continue to keep an eye on things but it now feels close to inevitable that we will use a feature to disable it conditionally.
  • We briefly touched on the removal of smartmatch, where both the extent of the situation and our thoughts so far are much less clear.
  • Connected to all that, we discussed some general thoughts on how not to keep finding ourselves in the same situation with changes like this, but found we probably already have all the mechanisms we need.
  • We decided that the provisions of the PPC process are the right way for pre-PPC “Signature named parameters” to play out so it has now become PPC 0024 with status “Exploratory”.
  • We took another brief look at the closure memory leak which is now #22547 and resolved to prepare to put down a consensus next time we meet.

[P5P posting of this summary]

Second Batch of LPW 2024 Talks Accepted

Yep, that's right - the second half dozen talks have been accepted for this year's London Perl and Raku Workshop. This puts our schedule at approximately 80% full, so if you are thinking about talking at the workshop then submit your proposal now!

The CFP will be closed at the end of September to give speakers sufficient time to finish their presentations and to allow the schedule to be created. We encourage all attendees to mark talks they are interested in as that will inform some of the schedule choices.

If you aren't thinking about talking then have a think about what you've been doing in the Perl and/or Raku space the last five years, or even just the general IT and development space. Perhaps there's something interesting you can talk about? If you don't feel it's a full fat talk then submit a lightning talk instead.

The London Perl and Raku Workshop will take place on 26th Oct 2024. Thanks to this year's sponsors, without whom LPW would not happen:

If you would like to sponsor LPW then please have a look at the options here: https://act.yapc.eu/lpw2024/sponsoring.html

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.