Perl subroutines with named paramters

Perl questions on StackOverflow

Published by Shiping on Friday 01 December 2023 02:28

While I'm trying to figure out a simple way to make a variable passed as a parameter to a subroutine immutable in the called subroutine, I came upon a webpage showing the following:

#!/usr/bin/perl 

# Function Definition 
sub Func(Int $variable) 
{ 
  # Operation to be performed 
  $variable /= 2; 
} 

# Defining a local variable 
my $value = 20; 

# Function Call with local variable 
print Func($value); 

Output:

Error: Cannot assign to an immutable value

Can anyone tell me what Perl version it's talking about? It talks about named parameters which can be set to be mutable or immutable, something I'm looking for, but the examples given don't work at all for me. I'm using Perl 5.26.3.

List of new CPAN distributions – Nov 2023

r/perl

Published by /u/perlancar on Friday 01 December 2023 00:03

List of new CPAN distributions – Nov 2023

Perlancar

Published by perlancar on Friday 01 December 2023 00:02

dist author abstract date
Acme-CPANAuthors-InMostCPANAuthors PERLANCAR Authors who are listed in Acme::CPANAuthors::* the most 2023-11-28T05:36:57
Acme-CPANAuthorsBundle-CPAN-Streaks PERLANCAR A collection of Acme::CPANAuthors::CPAN::Streaks::* modules 2023-11-25T06:53:34
Acme-CPANModules-CPANAuthors PERLANCAR List of Acme::CPANAUthors::* modules 2023-11-28T04:30:10
Acme-CPANModules-Locale-ID PERLANCAR List of modules related to the Indonesian locale (language, country) 2023-11-12T00:06:19
Acme-CPANModules-SmartMatch PERLANCAR List of modules to do smart matching 2023-11-05T00:05:29
Acme-DTUCKWELL-Utils DTUCKWELL The great new Acme::DTUCKWELL::Utils! 2023-11-03T08:58:51
Acme-Thing PERLANCAR Represent anything as Perl (CPAN) module 2023-11-26T00:06:07
Aion-Query DART functional interface for accessing database mysql and mariadb 2023-11-01T09:14:33
Aion-Telemetry DART measures the time the program runs between specified points 2023-11-01T12:23:16
Alien-Serd ZMUGHAL Find or build Serd RDF processor 2023-11-09T18:38:12
Alien-Sord ZMUGHAL Find or build Sord in-memory RDF store 2023-11-12T02:07:33
Alien-hdt_cpp ZMUGHAL Find or build hdt-cpp (RDF binary format library) 2023-11-12T04:34:33
Alien-zix ZMUGHAL Find or build Zix C99 data structure library 2023-11-09T17:56:33
AnyEvent-KVStore EINHVERFR A pluggable key-value store API for AnyEvent 2023-11-15T01:45:31
AnyEvent-KVStore-Etcd EINHVERFR An Etcd driver for AnyEvent::KVStore 2023-11-18T03:34:41
App-Bin-Search SKIM Tool to bitwise search of data in hexadecimal stream. 2023-11-26T12:35:16
App-CPANStreaks PERLANCAR Calculate various CPAN streaks 2023-11-25T05:12:55
App-DownloadsDirUtils PERLANCAR Utilities related to downloads directories 2023-11-16T04:30:27
App-FileFindUtils PERLANCAR Utilities related to finding files 2023-11-20T09:32:49
App-GUI-Juliagraph LICHTKIND drawing Mandelbrot and Julia fractals 2023-11-17T03:45:30
App-Hack-Exe DCHURCH An animated terminal app that pretends to hack a website, just like in the movies 2023-11-04T19:46:41
App-MARC-Leader SKIM Base class and script for parse and print MARC leader. 2023-11-19T20:08:27
App-randquote PERLANCAR Print a random quote 2023-11-19T00:05:05
App-wcgrep PERLANCAR Print lines matching a wildcard pattern 2023-11-17T09:30:30
At SANKO The AT Protocol for Social Networking 2023-11-22T03:45:18
Bandana TROTH Bandana – a light and powerful web framework 2023-11-12T18:01:09
Bencher-Scenarios-Log-ger PERLANCAR Scenarios for benchmarking Log::ger 2023-11-27T00:05:46
Business-TrueLayer LEEJO Perl library for interacting with the TrueLayer v3 API (https://docs.truelayer.com/) 2023-11-29T08:34:16
CLI-Simple BIGFOOT Simple command line script accelerator 2023-11-16T22:24:38
CPAN-API-BuildPL LEONT Documentation of the API for using Build.PL 2023-11-04T12:03:44
CPAN-Static LEONT Static Installation for CPAN distributions 2023-11-04T14:08:34
Chipcard-PCSC WHOM Communicate with a smart card using PC/SC from a Perl script 2023-11-20T20:41:56
Complete-Color PERLANCAR Completion routines related to colors 2023-11-30T10:19:49
Dancer2-Plugin-JsonApi YANICK JsonApi helpers for Dancer2 apps 2023-11-15T19:24:49
Dancer2-Plugin-OpenAPI YANICK create OpenAPI documentation of your application 2023-11-16T17:21:27
Data-MARC-Leader SKIM Data objects for MARC leader. 2023-11-17T23:58:17
Database-ManagedHandle MIKKOI Manage database handles safely for long running processes 2023-11-28T21:16:38
Database-Temp MIKKOI Create an ad-hoc database which drops itself automatically 2023-11-28T21:15:00
Dist-Zilla-Plugin-InsertDistFileLink PERLANCAR Insert links to distribution shared files into POD as HTML snippets 2023-11-09T08:08:46
File-Util-DirList PERLANCAR File utilities involving a list of directories 2023-11-15T10:28:11
File-Util-Sort PERLANCAR Routines related to sorting files in one or more directories 2023-11-26T08:59:52
File-Util-Symlink PERLANCAR Utilities related to symbolic links 2023-11-30T08:17:57
File-Util-Test PERLANCAR Utilities related mostly to testing/checking for files in directories 2023-11-17T02:42:09
Graphics-ColorNamesLite-EN PERLANCAR Lots of English color names and equivalent RGB values (lite version) 2023-11-30T09:52:46
Graphics-ColorNamesLite-ID PERLANCAR Indonesian color names and equivalent RGB values (lite version) 2023-11-30T09:53:08
Grpc-XS JOYREX binding to the grpc library. 2023-11-01T18:55:33
Ixchel VVELOX Automate various sys admin stuff. 2023-11-16T17:08:35
Locale-MaybeMaketext RBAIRWELL Find available localization / localisation / translation services. 2023-11-13T23:48:31
MARC-Leader SKIM MARC leader class. 2023-11-18T00:18:41
MARC-Leader-Print SKIM MARC leader class for print. 2023-11-19T16:45:10
Mo-utils-Date SKIM Mo date utilities. 2023-11-14T07:48:11
Mojolicious-Plugin-IsBot RAWLEYFOW A Mojolicious plugin that adds a helper to test if a request is a bot. 2023-11-03T16:10:22
Music-Bassline-Generate GENE Generate walking basslines – DEPRECATED 2023-11-12T04:12:43
Music-Bassline-Generator GENE Generate walking basslines – DEPRECATED 2023-11-12T04:20:30
Object-PadX-Role-AutoJSON SIMCOP Role for Object::Pad that dynamically handles a TO_JSON serialization based on the MOP 2023-11-15T15:30:02
Object-PadX-Role-AutoMarshal SIMCOP Automated nested object creation with Object::Pad 2023-11-15T15:30:13
OpenAIAsync SIMCOP OpenAI style Client and Server for processing various AI tasks 2023-11-23T14:06:33
OpenTelemetry-Exporter-OTLP JJATRIA An OpenTelemetry Protocol span exporter 2023-11-07T20:56:16
OpenTelemetry-SDK JJATRIA An implementation of the OpenTelemetry SDK for Perl 2023-11-01T00:00:34
PDK-Device CARELINE turns baubles into trinkets 2023-11-26T11:13:57
PGObject-Util-LogRep-TestDecoding EINHVERFR Parse Pg's test_decoding messages 2023-11-12T02:29:08
SPVM-Go KIMOTO Goroutines of The Go Programming Language 2023-11-08T01:07:43
SPVM-Thread KIMOTO Native Thread 2023-11-10T03:55:39
SPVM-Time-HiRes KIMOTO High Resolution Time 2023-11-27T02:24:13
Seq DAVIDRAAB A lazy sequence implementation 2023-11-21T00:38:56
Seq-Iter PERLANCAR Generate a coderef iterator from a sequence of items, the last of which can be a coderef to produce more items 2023-11-21T03:30:18
Set-Streak PERLANCAR Routines related to streaks (longest appearance in consecutive sets) 2023-11-23T15:02:15
Silicon-Chip-Btree PRBRENAN Implement a B-Tree as a silicon chip. 2023-11-11T04:13:38
Spreadsheet-Examples PERLANCAR A collection of various examples of spreadsheet files 2023-11-09T04:04:42
TAP-Formatter-GitHubActions JGOMEZ TAP Formatter for GitHub Actions 2023-11-28T21:44:42
TableData-Perl-CPAN-Release-Static-2023 PERLANCAR CPAN releases for the year 2023 2023-11-20T02:27:50
TableData-Perl-CPAN-Release-Static-2024 PERLANCAR CPAN releases for the year 2024 2023-11-20T04:56:56
Test-CVE HMBRAND Test current release against CVE's 2023-11-27T14:42:35
Test-Database-Temp MIKKOI Create temporary test databases and run tests in all available ones 2023-11-28T21:16:49
TextDoc-Examples PERLANCAR A collection of various examples of word-processor text document files 2023-11-17T08:07:28
Travel-Routing-DE-HAFAS DERF Interface to HAFAS itinerary services 2023-11-16T20:28:48
WebService-Readwise LANCEW Perl module to interact with Readwise.io API:w 2023-11-04T16:28:42
ipgrep RRWO grep files by CIDR 2023-11-07T16:54:39

Stats

Number of new CPAN distributions this period: 78

Number of authors releasing new CPAN distributions this period: 32

Authors by number of new CPAN distributions this period:

No Author Distributions
1 PERLANCAR 26
2 SKIM 6
3 ZMUGHAL 4
4 MIKKOI 3
5 KIMOTO 3
6 SIMCOP 3
7 EINHVERFR 3
8 JJATRIA 2
9 DART 2
10 GENE 2
11 LEONT 2
12 YANICK 2
13 PRBRENAN 1
14 RBAIRWELL 1
15 DTUCKWELL 1
16 WHOM 1
17 JGOMEZ 1
18 RRWO 1
19 LEEJO 1
20 LICHTKIND 1
21 DCHURCH 1
22 CARELINE 1
23 BIGFOOT 1
24 LANCEW 1
25 DAVIDRAAB 1
26 RAWLEYFOW 1
27 JOYREX 1
28 TROTH 1
29 DERF 1
30 SANKO 1
31 HMBRAND 1
32 VVELOX 1

On Golang I have the function Unix from time package with the following spec

https://pkg.go.dev/time@go1.21.4#Unix

func Unix(sec int64, nsec int64) Time

It does

Unix returns the local Time corresponding to the given Unix time, sec seconds and nsec nanoseconds since January 1, 1970 UTC

In other words, I am trying to decode a "datetime" from a given epoch in seconds + nanoseconds.

I find some alternatives to do the same in Perl such as

localtime($sec);

or using https://metacpan.org/pod/DateTime I have the constructor from_epoch

but in any case, I can only parse seconds, not nanoseconds.

Is there a way to do it easily in Perl (with or without external modules) or should I ignore the nanoseconds part since it may be irrelevant?

What is the best way to create a perl project in 2023

Perl questions on StackOverflow

Published by Tiago Peczenyj on Thursday 30 November 2023 17:31

Few years ago, to start a project, like a module to be available via CPAN, I used Dist:Zilla and few plugins, perl critic, perl tidy, nyt proof, test::more, etc.

Now I'd like to create a simple project -- a parser for a specific base64 encoded message, it should contain a constructor to return an object with few methods and maybe some constants. Maybe a command line tool.

I just don't know how to start a project from scratch anymore.

I imagine my package will be stored in lib/ directory, I should add a Readme, t/ for tests, etc.

How should I start? Should I use Module::Build and create a basic Build.PL or there are more easier/interessant ways to do it on 2023?

And how about code linting, formatting, testing? is there something new or relevant to check or should I continue with the good old tools?

Thanks in advance

Capture perl5343delta, perl5363delta, perl5382delta

Perl commits on GitHub

Published by leonerd on Thursday 30 November 2023 15:53

Capture perl5343delta, perl5363delta, perl5382delta

Add Perl versions 5.34.3, 5.36.3, 5.38.2 to perlhist.pod

Perl commits on GitHub

Published by leonerd on Thursday 30 November 2023 15:35

Add Perl versions 5.34.3, 5.36.3, 5.38.2 to perlhist.pod

I'm trying to draw a semi-transparent block onto an existing image using Perl's GD.pm.

My code looks like this:

use strict;
use GD;

my $img = GD::Image->new('cello.png');
GD::Image->trueColor(1);
$img->saveAlpha(1);
my $boxColor = $img->colorClosestAlpha(0,0,0,60);

$img->filledRectangle(0,300,600,400, $boxColor);

open(FH, '>', 'cello2.png') or die $!;
binmode FH;
print FH $img->png();
close FH;

This draws a black box on the image, but the box is completely opaque as if the alpha channel is being ignored. Any suggestions would be greatly appreciated.

I'm writing Perl code that takes a directory and its subdirectories and files, and then prints it to an Excel sheet using Excel::Writer::XLSX. The issue I'm facing is some of my directories have numerical names like "1", "2.4".

Here's my code:

use Excel::Writer::XLSX;  
my $workbook= Excel::Writer::XLSX->new( 'myExcel.xlsx' );  
my $ws = $workbook->add_worksheet();  
$path = "path_name";
{
    $i= 0;
    $j = 0;
    sub dir_listing {
        my ($root) = @_;
        $root .= '/';
        for my $f (glob "$root*")
        {
            if (-d $f)
            {
                $f =~ m/.*\/(.*)/;
                $ws->write($i,$j,$1);
                $j++;
                dir_listing($f);
                $j--;
            }
            if (-f $f)  
            {
                $f =~ m/.*\/(.*)/;
                $ws->write($i,$j,$1);
                $i++;
            }
        }
    }
}
dir_listing($path);

It's parsing through the numerical directories well and good, but it's not printing the directory name in the Excel sheet.

Argument "" isn't numeric in addition (+) at /home/priyansh.mehta/perl5/lib/perl5/Excel/Writer/XLSX/Worksheet.pm line 2510.

is the warning it shows after execution

I don't need the full path of the directory and files, only the names, hence the use of regex.

No warning of captures in alternations in Perl

r/perl

Published by /u/zhenyu_zeng on Thursday 30 November 2023 12:41

Hello,

On page 151 of Learning Perl: Making Easy Things Easy and Hard Things Possible, it says this code will cause warning

if ( $name =~ /(F\w+)|(P\w+)/ ) { # Fred or Pebbles? print "1: $1\n2: $2\n"; } 

With warnings on, one of those capture variables will complain about an uninitialized value.

But in the test, it doesn't.

use warnings; use v5.34; my $name="hello"; if ($name=~/(F\w+)|(P\w+)/){ print "1:$1\n2:$2\n"; } 

Everything is okay. Should this cause warning?

submitted by /u/zhenyu_zeng
[link] [comments]

Perl Weekly Challenge 245: Sort Language

blogs.perl.org

Published by laurent_r on Thursday 30 November 2023 04:22

These are some answers to the Week 245, 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 December 3, 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: Sort Language

You are given two arrays of languages and its popularity.

Write a script to sort the language based on popularity.

Example 1

Input: @lang = ('perl', 'c', 'python')
       @popularity = (2, 1, 3)
Output: ('c', 'perl', 'python')

Example 2

Input: @lang = ('c++', 'haskell', 'java')
       @popularity = (1, 3, 2)
Output: ('c++', 'java', 'haskell')

Sort Language in Raku

On reading the assignment, I initially thought for a minute or so that it would be quite easy to sort one array (@lang) in accordance with the values of another one (@popularity). But it immediately came to my mind that, in fact, you don't even need to actually sort anything. You can just use the second array (@popularity) as an index slice for the first one (@lang), so that we avoid the algorithmic complexity of a sort procedure and return directly the languages in the proper order. The sort-lang subroutine is thus a simple one-liner. Note that the input popularity is given with values starting at 1, whereas array or list indices start at 0, so we need the map {$_ - 1} expression to convert popularities into array indices.

sub sort-lang (@lang, @pop) {
    return ~ @lang[map {$_ - 1}, @pop];
}

my @tests = 
    { lang => <perl c python>, pop => (2, 1, 3)},
    { lang => <c++ haskell java>, pop  => (1, 3, 2)};

for @tests -> %test {
    printf "%-20s", "%test<lang> => ";
    say sort-lang %test<lang>, %test<pop>;
}

This program displays the following output:

$ raku ./sort-language.raku
perl c python =>    c perl python
c++ haskell java => c++ java haskell

Sort Language in Perl

This is a port to Perl of the Raku program above, and we are using array slices just like in the Raku implementation. Please refer to the previous section for any explanation.

use strict;
use warnings;
use feature 'say';

sub sort_lang {
    my @lang = @{$_[0]};
    my @pop  = @{$_[1]};
    return join " ",  @lang[map {$_ - 1} @pop];
}

my @tests = 
    ({ lang => [<perl c python>],    pop => [2, 1, 3]},
     { lang => [<c++ haskell java>], pop => [1, 3, 2]});

for my $test (@tests) {
    printf "%-22s", "@{$test->{lang}} => ";
    say sort_lang $test->{lang}, $test->{pop};
}

This program displays the following output:

$ perl ./sort-language.pl
perl c python =>      c perl python
c++ haskell java =>   c++ java haskell

Wrapping up

The next week Perl Weekly Challenge will start soon. If you want to participate in this challenge, please check https://perlweeklychallenge.org/ and make sure you answer the challenge before 23:59 BST (British summer time) on December 10, 2023. And, please, also spread the word about the Perl Weekly Challenge if you can.

bisect: explicitly set diff path prefixes

Perl commits on GitHub

Published by mauke on Thursday 30 November 2023 00:25

bisect: explicitly set diff path prefixes

The patch code in Porting/bisect-runner.pl assumes `git show` will
always display filenames with "a/..." and "b/..." prefixes. This is not
necessarily the case. For example, the config settings
diff.mnemonicPrefix and diff.noprefix can cause different prefixes or no
prefixes at all to be used. In that case (e.g. after `git config
--global diff.noprefix true`), bisect will halt like this:

    HEAD is now at 95388f2eb2 perlhist: Move 5.26.0 to another table to fix line length
    can't find file to patch at input line 24
    Perhaps you used the wrong -p or --strip option?
    The text leading up to this was:
    --------------------------
    |commit 46bfb3c49f22629a21d99ff2d02461a2a8a9aac4
    |Author: Nicholas Clark <nick@ccl4.org>
    |Date:   2022-08-02 16:40:39 +0200
    |
    |    Configure should avoid looping infinitely repeating the same question
    |
    |    Configure's helper function ./myread is intended to loop until it gets an
    |    acceptable answer. For a couple of cases, an empty string is not acceptable
    |    (eg 'Where is your C library?', if all automated attempts at answering this
    |    have failed). In these cases, if Configure's standard input is /dev/null (or
    |    closed), the shell read returns an empty string, and ./myread repeats the
    |    question.
    |
    |    Before this commit, it would loop infinitely (generating continuous terminal
    |    output). With this commit, we add a retry counter - if it asks the same
    |    question to many times, it aborts Configure. This means that unattended
    |    ./Configure runs should now always terminate, as termination with an error
    |    is better than spinning forever.
    |
    |diff --git Configure Configure
    |index 9d7fc39419..9d3b5f73b1 100755
    |--- Configure
    |+++ Configure
    --------------------------
    File to patch:

... which seems silly, seeing as how the filename is right there ("diff
--git Configure Configure", "--- Configure", "+++ Configue") and yet
bisect has to ask which file to patch ("it's Configure, duh!").

This commit tells git explicitly to use "a/" and "b/" as prefixes, which
works no matter what the local config settings are.

Beginner question

r/perl

Published by /u/throwaway679635 on Wednesday 29 November 2023 21:50

Hello, I'm new to perl, I have some code which I have modified, but the newer version doesn't work when there isn't any 'xxx' in the input file: why is that?

Also is there a way to preserve ARGV when flushing the whole file using the diamond operator?

Older:

perl -WTe 'my $tmp = $ARGV[0]; my $x = do { local $/; <> } =~ /^\s?+'"'"'\s?+(\w+(\.\w+)?+)\s?+'"'"'/ ? do { $1 =~ s/\./\//g; $1 } : do { $tmp =~ /(.+)\./g; $1 }; print $x . "~"' file.txt

Newer (I can match regex on shift(), right?):

perl -WTe '&{ sub { my $x = do { local $/; <> } =~ /^\s?+'"'"'\s?+(\w+(\.\w+)?+)\s?+'"'"'/ ? do { $1 =~ s/\./\//g; $1 } : do { shift =~ /(.+)\./g; $1 }; print $x . "~" } }($ARGV[0])' file.txt

sorry for my bad english

Edit: sorry for all the stuff I forgot to write yesterday, I was really tired

Edit2: fixed typos

submitted by /u/throwaway679635
[link] [comments]

Module::CoreList updated for v5.34.3, v5.36.3 and v5.38.2

Perl commits on GitHub

Published by bingos on Wednesday 29 November 2023 21:32

Module::CoreList updated for v5.34.3, v5.36.3 and v5.38.2

Perl 5.34.3, Perl 5.36.3 and Perl 5.38.2 are now available

r/perl

Published by /u/Grinnz on Wednesday 29 November 2023 18:25

cpan/Test-Simple - Update to version 1.302197

Perl commits on GitHub

Published on Wednesday 29 November 2023 16:57

cpan/Test-Simple - Update to version 1.302197

1.302197  2023-11-28 17:30:37-08:00 America/Los_Angeles

    - Add ability to attach timestamps to trace objects via api or env var

1.302196  2023-10-24 10:27:33-07:00 America/Los_Angeles

    - Fix #882
    - Fix handling of VSTRING and LVALUE refs in is_deeply() #918
    - Merge several doc fixes from mauke

AppRunner - The Good, Bad and the Ugly

Background

In May of 2021, AWS released AppRunner to the public.

AWS App Runner is an AWS service that provides a fast, simple, and cost-effective way to deploy from source code or a container image directly to a scalable and secure web application in the AWS Cloud. You don’t need to learn new technologies, decide which compute service to use, or know how to provision and configure AWS resources.

App Runner connects directly to your code or image repository. It provides an automatic integration and delivery pipeline with fully managed operations, high performance, scalability, and security.

AppRunner
Architecture

What makes AppRunner so compelling are these important features:

  • Creates the entire infrastructure required for hosting a scalable web application
  • Connects directly to your code or image repository AND can automatically redeploy the application when assets are updated
  • Can scale up or down based on traffic
  • Very cost effective - you only pay for resources consumed when your application is in use
  • Associate your custom domain with an AppRunner endpoint.
  • It’s much less expensive than provisioning all of the resources necessary to host your application yourself!

My Use Case

Back in 2012, I started a SaaS application (Treasurer’s Briefcase) for providing recordkeeping services for small non-profit organizations like PTOs, PTAs and Booster clubs. Back then, I cobbled together the infrastructure using the console, then started to explore CloudFormation and eventually re-architected everything using Terraform.

The application is essentially based on a LAMP stack - well sort of since I use a different templating web framework rather than PHP. The stack consists of an EC2 that hosts the Apache server, an EC2 that hosts some backend services, an ALB, a MySQL RDS instance and a VPC. There are a few other AWS services used like S3, SQS and EFS, but essentially the stack is relatively simple. Even so, provisioning all of that infrastructure using Terraform alone and creating a development, test, and production environments was a bit daunting but a great learning experience.

Starting with the original infrastructure, I reverse engineered it using terraforming and then expanded it using terraform.

The point being, it wasn’t necessarily easy to get it all right the first time. Keeping up with Terraform was also a challenge as it evolved over the years too. Moreover, maintaining infrastructure was just another task that provided no incremental value to the application. Time spent on that task took away from creating new features and enhancements that could provide more value to customers.

Enter AppRunner…with the promise of taking all of that work and chucking it out the window. Imagine creating a Docker container with your application and handing it to AWS and saying “host this for me, make it scalable, create and maintain an SSL certificate for me, create a CI/CD pipeline to redeploy the application when I make changes and make it cheap.” I’m in.

Not So Fast Skippy

AppRunner has evolved over the years and has become much more mature. However, it still has some warts and pimples that might make you think twice about using it. Back in 2021 it was an interesting new service, an obvious evolutionary step from Fargate Tasks which provide some of the same features as AppRunner. Applications that utilized Fargate Tasks as the basis for running their containerized web applications still had to provision a VPC, load balancers, and manage scaling on their own. AppRunner bundles all of those capabilities and creates a compelling argument for moving Fargate based apps to AppRunner.

Prior to October 2022 AppRunner did not support the ability to access resources from within a VPC. That made it impossible for example, to use a non-publicly accessible RDS instance. With that addition in October of 2022, it was now possible to have a web application that could access your RDS in your VPC.

The fall of 2023 has seen several changes that make AppRunner even more compelling:

Change Description Date
Release: App Runner adds supports for AWS Europe (Paris), AWS Europe (London), and AWS Asia Pacific (Mumbai) Regions AWS App Runner now supports AWS Europe (Paris), AWS Europe (London), and AWS Asia Pacific (Mumbai) Regions. November 8, 2023
Release: App Runner adds dual stack support for incoming network traffic AWS App Runner now adds dual stack support for incoming traffic through public endpoints. November 2, 2023
Release: App Runner automates Route 53 domain configuration for your services AWS App Runner automates Route 53 domain configuration for your App Runner service web applications. October 4, 2023
Release: App Runner adds support for monorepo source-code based services AWS App Runner now supports the deployment and maintenance for monorepo source-code based services. September 26, 2023
Release: App Runner adds more features to auto scaling configuration management AWS App Runner enhances auto scaling configuration management features. September 22, 2023

Some of the limitations of AppRunner currently include:

  • Inability to mount file systems (like EFS)
  • While you can associate a custom domain, it cannot provision www from the console (in fact I have been unable to get it to work properly from the CLI either although the documentation indicates it should work)
  • Still unavailable in some regions
  • Cannot use security groups to limit access

The first limitation is a bit of show-stopper for more than a few web applications that might rely on mounted file systems to access assets or provide a stateful storage environment. For my application I use EFS to create session directories for logged in users. Using EFS I can be assured that each EC2 in my web farm accesses the user’s session regardless of which EC2 serves the request. Without EFS, I will be forced to re-think how to create a stateful storage environment for my web app. I could use S3 as storage (and probably should) but EFS provided a “quick-shot-on-goal” at the time.

The second limitation was just frustrating as associating a custom domain sort of kinda works. If I associate a domain managed by AWS (in the same account as my AppRunner application) then I was able to get the TLD to resolve and work as expected. AppRunner was able to associate my appliation to the domain AND provide an SSL certificate. It will redirect any http request to https. Unfortunately, I could not associate www sub-domain using the CLI as documented. In fact I could not even get the CLI to work without trying to enable the www sub-domain. Working with AWS support confirmed my experience and I still have a ticket pending with support on this issue. I’m confident that will be resolved soon(?) so it should not limit my ability to use this service in the future.

Conclusion

AppRunner is an exciting new service that will make application development and deployment seamless allowing developers to focus on the application not the infrastructure.

You can find the AppRunner roadmap and current issues here.

Curated list of Perl modules

blogs.perl.org

Published by Ron Savage on Monday 27 November 2023 09:20

See Perl.html
It's an example of the fabulous TiddlyWiki (tiddlywiki.com), so it's about 230,000 bytes.

Perl Weekly #644 - Perl Sponsor?

dev.to #perl

Published by Gabor Szabo on Monday 27 November 2023 08:09

Originally published at Perl Weekly 644

Hi there,

Do you or your company sponsor Perl directly or indirectly?

As we all know, The Perl and Raku Foundation, is the parent organisation responsible for the development of Perl and Raku programming languages. They are also the single point of contact for any donations, whether individual or corporate. Without a doubt they are doing great service promoting Perl and Raku programming languages. I have personally seen how they support annual conferences around the globe.

Why am I talking about it today?

I run The Weekly Challenge project primarily focus on Perl and Raku but open to all programming languages. It was started on 25th March 2019. It has been going on un-interrupted ever since, thanks to the strong 350+ members of Team PWC. We were lucky enough to have solo sponsor, Perl Careers run by Peter Sergeant since July 2019 without break. Initially we had weekly prize sponsorship but later it was changed to monthly sponsorship. The best part was, I didn't have to move a finger to find the sponsor. Pete was generous enough to come forward and continued supporting the project for such a long time.

Is it time to look for new sponsor?

Well, we are not expensive to sponsor, honestly speaking. The prize money has been 50 USD since the beginning. Although I have been looking for new sponsors for sometime but never done anything about it. It is just not my cup of tea. Because of this, I put the code move on hold for such a long time. Ideally I wanted to move the code base to pure Perl solution instead of currently Hugo which is based on Go. I also wanted to move away from GitHub pages hosted solution to a proper hosted solution that we can manage ourself. I could have requested TPRF for financial help but again I am not competent enough to make formal request. As we are growing very fast every week, it is getting out of hand to manage the contributions by the team member. GitHub takes lot longer to process the data as some of the team member complained about it too. I wish we had our own repository to manage the contributions.

Any help or suggestions are most welcome.

Last but not the least, please do remember all those affected by the recent conflicts in your daily prayer. Enjoy rest of the newsletter.

--
Your editor: Mohammad S. Anwar.

Announcements

This Week in PSC (124)

Please checkout the weekly update by Perl Steering Council.

This week in PSC (125)

Bonus updates, two in a week, thank you Perl Steering Council.

German Perl/Raku Workshop 2024

Official announcement to submit papers for GPRW 2024.

Articles

Turn off tainting in brewed Perl

Have you played with tainting on/off? Nice discussion how Perl behaves in each scenario.

An Option for Syntax Highlighting on blogs.perl.org

Fun work if you are frequent blogger on bpo.

Curated list of Perl modules

One of the many great CPAN Testers, Ron, shared the curated list of Perl modules.

The Weekly Challenge

The Weekly Challenge by Mohammad Anwar will help you step out of your comfort-zone. You can even win prize money of $50 Amazon voucher by participating in the weekly challenge. We pick one winner at the end of the month from among all of the contributors during the month. The monthly prize is kindly sponsored by Peter Sergeant of PerlCareers.

The Weekly Challenge - 245

Welcome to a new week with a couple of fun tasks: "Sort Language" and "Largest of Three". If you are new to the weekly challenge, why not join us and have fun every week? For more information, please read the FAQ.

RECAP - The Weekly Challenge - 244

Enjoy a quick recap of last week's contributions by Team PWC dealing with the "Count Smaller" and "Group Hero" tasks in Perl and Raku. You will find plenty of solutions to keep you busy.

Counting the Smallest Embiggens the Group Hero

Clever use of map and grep to get the desired result. Well done and thanks for sharing.

244

Very compact and cute solutions. You must check it out. Thanks for your contributions.

The Smaller Hero

Quality post with the most creative title every week. Keep it up great work.

Let me count the ways

So many variations and ideas. Plenty to keep you all busy. Thanks for sharing.

We Can Be Heroes, Just For One Day

Thanks for reviewing CPAN module and sharing the details. Keep it up and well done.

And then a hero comes along

Bloggng style is 2 way communication and I love it. Well done.

Perl Weekly Challenge: Week 244

Raku one-liner, very impressive. Please keep us entertained every week.

Smaller Heroes

In depth analysis and discussed solutions. Highly recommended.

Perl Weekly Challenge 244: Count Smaller

Simple and straight forward solutions both in Perl and Raku, no gimmicks. Thank you.

Perl Weekly Challenge 244: Group Hero

Showing off the power of Raku built-in features. Perl is not far off either. Well balanced solutions. Keep it up great work.

THE WEEKLY CHALLENGE - 244

Love the innocent comparison of Perl and Python. Well done.

grep and filter everywhere!

Compact solutions in Raku and bonus in Python too. Thanks for sharing.

Perl Weekly Challenge 244

Use of CPAN module is clever move to get a compact solution. Well done.

Count… just a little bit smaller…

Musical background to this week solution. Very interesting, keep it up.

The smallest hero

Scalable and Do It Yourself styled solutions. Great effort, keep it up.

The Weekly Challenge #244

Clever approach to solve the task. You must checkout yourself.

Counting Your Heroes

Rust is very impressive, I must admit. You should check it out yourself. Highly recommended.

Weekly Challenge 244

This is incredible, one-liner in Python. Simply the best. Thanks for sharing.

Rakudo

2023.47 FOSDEM devving

Weekly collections

NICEPERL's lists

Great CPAN modules released last week;
StackOverflow Perl report.

The corner of Gabor

A couple of entries sneaked in by Gabor.

Starting the Site Checker project

The site checker is a new project of mine. If you have a web site, let me know what would you need to make this useful for you!

First version of the Code Maven Static Site Generator

I've started to rewrite the code behind the Perl Maven and Code Maven sites to be a static site generator.

Rust Maven

The Rust Maven web site contains all the new Rust-related articles and Rust-related slides. If you are interested in Rust sign up to my newsletter!

Perl Jobs by Perl Careers

Perl Programmer Opportunity - Join a Prominent Tech Publishing Powerhouse in the Philippines

Our UK-based client is a global leader in the enterprise technology publishing industry, providing audiences worldwide with stimulating perspectives and unique news on enterprise tech that matters today and tomorrow. They are currently seeking a passionate and exceptional Perl programmer based in the Philippines to join their team.

Adventure Awaits! Senior Perl roles in Malaysia, Dubai and Malta

Clever folks know that if you’re lucky, you can earn a living and have an adventure at the same time. Enter our international client: online trading is their game, and they’re looking for Perl People with passion, drive, and an appreciation for new experiences.

You joined the Perl Weekly to get weekly e-mails about the Perl programming language and related topics.

Want to see more? See the archives of all the issues.

Not yet subscribed to the newsletter? Join us free of charge!

(C) Copyright Gabor Szabo
The articles are copyright the respective authors.

Counting the Smallest Embiggens the Group Hero

RabbitFarm Perl

Published on Sunday 26 November 2023 14:30

The examples used here are from the weekly challenge problem statement and demonstrate the working solution.

Part 1

You are given an array of integers. Write a script to calculate the number of integers smaller than the integer at each index.

Solution


use v5.38;
sub count_smaller{
    my @integers = @_;
    my @integers_sorted = sort {$a <=> $b} @integers;
    return map {  
        my $x = $_;
        (grep { $integers[$x] == $integers_sorted[$_]} 0 .. @integers_sorted - 1)[0];
    } 0 .. @integers - 1;
}

MAIN:{
    say join q/, /, count_smaller qw/8 1 2 2 3/;
    say join q/, /, count_smaller qw/6 5 4 8/;
    say join q/, /, count_smaller qw/2 2 2/;
}

Sample Run


$ perl perl/ch-1.pl 
4, 0, 1, 1, 3
2, 1, 0, 3
0, 0, 0

Notes

I'll admit this is a little convoluted. Since we already have a nested loop with the map and grep this is not any more efficient than if I had just searched and summed the smaller elements.

The idea here is to sort the array of integers and then for each element in the original array find it's position in the sorted array. The number of elements preceding the sought after element in the sorted list are the number of elements which are smaller than it.

This approach may have a performance benefit in the case of extremely large lists coupled with early termination of the inner loop.

Part 2

You are given an array of integers representing the strength. Write a script to return the sum of the powers of all possible combinations; power is defined as the square of the largest number in a sequence, multiplied by the smallest.

Solution


use v5.38;
sub group_hero{
    my @group = @_;
    my $group_hero = 0;
    do{
        my $indices = $_;
        my @hero = sort {$a <=> $b} @group[grep{vec($indices, $_, 1) == 1} 0 .. @group - 1];
        $group_hero += ($hero[@hero - 1]**2 * $hero[0]);
    } for 1 .. 2**@group - 1;
    return $group_hero;
}

MAIN:{
    say group_hero qw/2 1 4/;
}

Sample Run


$ perl perl/ch-2.pl 
141

Notes

A core part of this problem is to compute the Power Set, set of all subsets, of the original array. To do this we use the well known trick of mapping the set bits of the numbers from 1 .. N^2, where N is the size of the array, to the array indices.

@group[grep{vec($indices, $_, 1) == 1} 0 .. @group - 1] examines which bit within each number $_ in 1 .. 2**@group - 1 are set and then uses them as the indices to @group. The elements from within @group that are found this way are then sorted to obtain the maximum and minimum needed for the final calculation.

References

Power Set

Challenge 244

Weekly Challenge 244

dev.to #perl

Published by Simon Green on Sunday 26 November 2023 11:20

Each week Mohammad S. Anwar sends out The Weekly Challenge, a chance for all of us to come up with solutions to two weekly tasks. My solutions are written in Python first, and then converted to Perl. It's a great way for us all to practice some coding.

Challenge, My solutions

Task 1: Count Smaller

Task

You are given an array of integers.

Write a script to calculate the number of integers smaller than the integer at each index.

My solution

This is a one-liner in Python

solution = [sum(1 for j in ints if j < i) for i in ints]

Breaking it down:

  • for i in ints iterates through the supplied list, assigning each value to the variable i.
  • sum(1...) will count the number of elements that satisfy the condition.
  • for j in ints creates an inner loop, assigning each value to the variable 'j'.
  • Finally j < i will only count the elements where the value in the inner loop is lower than the outer loop.

As Perl does not provide an easy way for double loops, I create a separate function to calculate the values less than a number, and then use the map function to iterate through each value.

sub less_than($i, $ints) {
    return scalar( grep { $_ < $i } @$ints );
}

my @solution = map { less_than( $_, \@ints ) } @ints;

Examples

$ ./ch-1.py 8 1 2 2 3
4, 0, 1, 1, 3

$ ./ch-1.py 6 5 4 8
2, 1, 0, 3

$ ./ch-1.py 2 2 2
0, 0, 0

Task 2: Group Hero

Task

You are given an array of integers representing the strength.

Write a script to return the sum of the powers of all possible combinations; power is defined as the square of the largest number in a sequence, multiplied by the smallest.

My solution

For this task, I create a function called calculate_power that returns the square of the largest number multiplied by the smallest number.

def calculate_power(numbers):
    min_int = min(numbers)
    max_int = max(numbers)
    return max_int ** 2 * min_int

In the main function, I create a loop called length which goes from 1 to the length of the supplied list. For each length, I compute all combinations. Thankfully Python has a combination function in itertools.

for length in range(1, len(ints)+1):
    power += sum(calculate_power(c) for c in combinations(ints, length))

Perl's combination function comes from the Algorithm::Combinatorics module.

foreach my $len ( 1 .. $#ints+1) {
    my $iter = combinations(\@ints, $len);
    while (my $c = $iter->next) {
        $power += calculate_power($c);
    }
}

Examples

$ ./ch-2.py 2 1 4
141

Perl Grants October 2023 Results, and New Call for Grant Applications

Perl Foundation News

Published by Saif Ahmed on Sunday 26 November 2023 06:52


October 2023 Round Results

The October round of grant applications have been passed through the first stage of processing. Both have passed, and are awaiting funding clearance from our treasurer.

Perl GPT

An interesting project trying to assist developers using AI was proposed by John Napiorkowski and Robert Grimes. This was aimed at feeding curated available quality bits of code into an AI model, and using an LLM to generate code. This has not yet visibly started but already has some enthusiastic following. Some practicalities are not specified, for example the IP of code and documentation used to train and that of the code generated, and cetainly those of us using GitHub are aware of the ethical complexities of allowing a helper AI using your code in other people's projects. Nor, for example, is the mitigation for potential to generate malicious code within the scope of this project. For these reasons, the Project has been split into two segments; a mini grant to kickstart the presence, analysis and initial coding process phase; this is then re-reviewed and if passed, a further production phase is supported.

Perl Core Grant PEVANS

Paul Evans is well known for a large number of Perl related contributions. Currently engaged in, amongst other things, a Object model that remains compatible with the core philosophies of Perl, bringing performance and simplicity into object cration into the Core. Perl has a large number of loosely compatible OOP paradigms; these are often powerful, hugely complex, heavy-weight, resource intensive frameworks, and therefore difficult to adopt into the core. For example Moose and Venus are superb super-OOPs, more powerful than those in many other languages. While these remain crucial to modern Perl application development, a model that has to be integrated into the core has different objectives, in terms of performance, robustness and abilitiy to not break existing applications. This challenge has been accepted by Paul and needs some support for this intensive task.


Call for grant applications

Grant applications are invited once again. Projects that are already in progress, that are open source, and those that benefit the Perl Community or the Perl Core may apply for additional support. There are three categories of Grants

1. General Grants:

  • Type of Idea: Anything, code, documentation, teaching material, text book
  • Who can apply: Anybody, apart from members of the Perl Foundation
  • Conditions: The Project must benefit the community, even if it is a small part of the community

2. Core development:

See PERL CORE DEVELOPMENT FUND and RAKU DEVELOPMENT FUND pages

  • Type of Idea: Code that ends up contributing to Core Perl or Raku
  • Who can apply: Any Core Perl Developer or contributor to Raku specification/implementation
  • Conditions: The project and the Author must be endorsed by someone with Perl Core Commit privilges or the Raku steering council

3. Perl/Raku Resource Modernisation Grants

  • Type of Idea: A resource (a book, website, etc) that already exists, but needs to meet modern Perl standards
  • Who can apply: Someone holding the copyright to the original work
  • Conditions: A commitment to Publish. The Foundation will not ask for any royalties, but may offer editors to review the project standards.

How The Grants Applications Process Works

Read the HOW TO WRITE A PROPOSAL

(cdlxxi) 17 great CPAN modules released last week

Niceperl

Published by Unknown on Saturday 25 November 2023 21:32

Updates for great CPAN modules released last week. A module is considered great if its favorites count is greater or equal than 12.

  1. App::Netdisco - An open source web-based network management tool.
    • Version: 2.070003 on 2023-11-24, with 16 votes
    • Previous CPAN version: 2.070001 was 9 days before
    • Author: OLIVER
  2. DBIx::DataModel - UML-based Object-Relational Mapping (ORM) framework
    • Version: 3.06 on 2023-11-22, with 12 votes
    • Previous CPAN version: 3.05 was 3 months, 27 days before
    • Author: DAMI
  3. Dist::Zilla - distribution builder; installer not included!
    • Version: 6.031 on 2023-11-21, with 183 votes
    • Previous CPAN version: 6.030 was 10 months, 2 days before
    • Author: RJBS
  4. Getopt::Long::Descriptive - Getopt::Long, but simpler and more powerful
    • Version: 0.112 on 2023-11-21, with 54 votes
    • Previous CPAN version: 0.111 was 10 months, 20 days before
    • Author: RJBS
  5. Image::ExifTool - Read and write meta information
    • Version: 12.70 on 2023-11-19, with 40 votes
    • Previous CPAN version: 12.60 was 7 months, 14 days before
    • Author: EXIFTOOL
  6. Math::BigInt - Pure Perl module to test Math::BigInt with scalars
    • Version: 2.001001 on 2023-11-21, with 13 votes
    • Previous CPAN version: 2.001000 was 8 days before
    • Author: PJACKLAM
  7. Minion - Job queue
    • Version: 10.27 on 2023-11-20, with 102 votes
    • Previous CPAN version: 10.26 was 10 days before
    • Author: SRI
  8. Module::CoreList - what modules shipped with versions of perl
    • Version: 5.20231120 on 2023-11-20, with 43 votes
    • Previous CPAN version: 5.20231025 was 26 days before
    • Author: BINGOS
  9. perl 5.36.2 - The Perl 5 language interpreter
    • Version: 5.036002 on 2023-11-25, with 419 votes
    • Previous CPAN version: 5.36.1 was 1 year, 7 months, 2 days before
    • Author: PEVANS
  10. perl 5.38.1 - The Perl 5 language interpreter
    • Version: 5.038001 on 2023-11-25, with 419 votes
    • Previous CPAN version: 5.38.0 was 4 months, 23 days before
    • Author: PEVANS
  11. PerlPowerTools - BSD utilities written in pure Perl
    • Version: 1.041 on 2023-11-24, with 37 votes
    • Previous CPAN version: 1.040 was 1 month, 22 days before
    • Author: BDFOY
  12. Software::License - packages that provide templated software licenses
    • Version: 0.104005 on 2023-11-21, with 15 votes
    • Previous CPAN version: 0.104004 was 5 months, 28 days before
    • Author: RJBS
  13. SPVM - SPVM Language
    • Version: 0.989063 on 2023-11-22, with 31 votes
    • Previous CPAN version: 0.989061 was 8 days before
    • Author: KIMOTO
  14. SQL::Abstract::More - extension of SQL::Abstract with more constructs and more flexible API
    • Version: 1.40 on 2023-11-20, with 21 votes
    • Previous CPAN version: 1.39 was 1 year, 3 months, 29 days before
    • Author: DAMI
  15. Sub::Exporter - a sophisticated exporter for custom-built routines
    • Version: 0.991 on 2023-11-24, with 36 votes
    • Previous CPAN version: 0.990 was 4 months, 2 days before
    • Author: RJBS
  16. Text::CSV_XS - Comma-Separated Values manipulation routines
    • Version: 1.53 on 2023-11-23, with 99 votes
    • Previous CPAN version: 1.52 was 2 months, 2 days before
    • Author: HMBRAND
  17. WWW::Mechanize::Chrome - automate the Chrome browser
    • Version: 0.72 on 2023-11-21, with 21 votes
    • Previous CPAN version: 0.71 was 6 months, 29 days before
    • Author: CORION

Perl and Raku Dev Room @FOSDEM 24

dev.to #perl

Published by r on Friday 24 November 2023 09:44

Hi,

at 2024 FOSDEM there will be a Perl and Raku "Dev Room"
https://fosdem.org/2024/schedule/track/perl-raku/

This week in PSC (125) | 2023-11-23

blogs.perl.org

Published by Perl Steering Council on Friday 24 November 2023 02:52

The PSC met today. In summary:

  • Paul’s TPRF grant was accepted, he plans to spend some of that time to work on some PPCs first (qt strings, overload)
  • FOSDEM Perl Devroom CfP: none of us are planning to attend in person, but if someone else wanted to present on our behalf we could coördinate with them and work out a subject to talk about
  • Discussed coming up with a Perl roadmap that we could present to the world (and entice sponsorship for TPRF’s Perl Development Fund and Grants program)
  • We discussed opening up our meetings to the occasional guest, so they could see what we’re actually doing (boring!) and give us an outside perspective

saluting face

rjbs forgot what he was saying

Published by Ricardo Signes on Thursday 23 November 2023 23:35

I am a big fan of emoji. I don’t have a position on their suitability for inclusion in Unicode on first principles or anything. I just think they’re fun, and using them is convenient and makes life a little more whimsical.

One of the more recent updates to Unicode’s emoji repertoire is SALUTING FACE, meaning that there is now an emoji equivalent to the ASCII o7. (Let’s not get into the mirroring of the image right now, I have more serious topics to discuss.)

Here’s the saluting face emoji in Apple’s emoji set:

saluting face emoji

It’s a pretty reasonable emoji in the “yellow face just trying to live its life” category, which is a strong category to start with. It also makes clear once and for all that the yellow face is not a marine, which is one less thing for me to wonder about. The thing is, when I started using this emoji in place of o7, something started to nag at me. Visually, I wanted this to be “right half of yellow face’s face, with saluting hand”. It just didn’t seem like it was half the face, though. It seemed like at the far right edge, the tangent was sloping down, showing we were past the center. After days of squirming and feeling uncertain, I finally looked into it.

saluting face compared to neutral face

Well, there it is! The saluting face is clearly more than half of a standard yellow face. Also interesting is that NEUTRAL FACE’s mouth is far broader. I think this is more evidence to my long-held claim that it’s hardly a neutral face. It’s clearly an expression of suppressed annoyance, and probably somebody vetoed STOICALLY SUFFERING THROUGH NONSENSE FACE. Meanwhile, the saluting face is wearing a truly neutral expression, as you’d expect from someone on-duty and saluting.

I still liked to think we were seeing just half of saluting face’s face, though, and I mocked up an emoji that shows us the other half, maintaining proportions.

the whole saluting face

This is now the :salutes: emoji at work, and it sees a fair amount of use. I am glad to know that I have contributed something to our work culture, and especially that it is a way of showing one respects one’s duties.

This Week in PSC (124)

blogs.perl.org

Published by Perl Steering Council on Thursday 23 November 2023 22:15

This week we:

  • Reviewed some recent email threads:
    • Returning values from require multiple times - seems not useful as compared to using do FILE or the new load_module builtin
    • CPAN.pm observed to use lots of memory, but also complicated to fix. It might benefit a new smaller simpler tool being provided by Perl core
  • Perl 5.39.5 is due soon and we have release managers up to 5.39.8, but we’re still in need of folks to do up to 5.40.0

An Option for Syntax Highlighting on blogs.perl.org

blogs.perl.org

Published by Oodler 577 on Thursday 23 November 2023 07:51

I've struggled with the syntax highlighting here on this blog. I really want to use this site and I will continue to do so.

After trying in vain to get some "auto" syntax highlighting here via the editor, I reached for an old trick I've used in the past. Generating HTML using some external service. After a quick Google search, I found https://tohtml.com/perl/. Given a block of Perl code, it'll generate HTML based syntax highlighting that one may add to their post. For example,

Decent Syntax Highlighting (from tohtml.com/perl)

use Dispatch::Fu;          # exports 'dispatch' and 'on', which are needed
use Test::More tests => 1;
 
my $INPUT = q{case1};
 
my $results = dispatch {
    my $input_str = shift;
    xdefault $input_str, q{do_default};
}
$INPUT,
  on default => sub { 6 },
  on case0   => sub { 0 },
  on case1   => sub { 1 },
  on case2   => sub { 2 },
  on case3   => sub { 3 },
  on case4   => sub { 4 },
  on case5   => sub { 5 };
 
is $results, 1, q{POD example for xdefault works};

It has been suggested to use an approach that uses "pre" and "code" HTML, and results in the following:

Insufficient Syntax Highlighing (internal)


use Dispatch::Fu;    # exports 'dispatch' and 'on', which are needed
use Test::More tests => 1;
my $INPUT = q{case1};
my $results = dispatch {
    my $inputstr = shift;
    xdefault $inputstr, q{do_default};
}
$INPUT,
  on default => sub { 6 },
  on case0   => sub { 0 },
  on case1   => sub { 1 },
  on case2   => sub { 2 },
  on case3   => sub { 3 },
  on case4   => sub { 4 },
  on case5   => sub { 5 };
is $results, 1, q{POD example for xdefault works};

Conclusion

However this is not going to satisfy what I want to see. Some notes with using https://tohtml.com/perl/:

  • when using the site, choose the "Copy Styled" in the "Highlighted RTF:" section
  • drop this as-is in your markdown editor of this site
  • blogs.perl.org will cut off anything at what looks like 80 characters
  • this approach is clearly using unmaintanable code blocks, if you change your code you must regenerate the HTML blob from https://tohtml.com/perl/

The last thing I want to do is bag on this site. I prefer to use blogs.perl.org over anything else, I just think we need to try harder to provide properly colored code examples.

Do you have a method that works internally or a better suggestion for creating properly highlighted code blocks at blogs.perl.org?

Many have suggested using dev.to or some other site. As much as I appreciate that suggestion, I am trying to solve an issue here so that we can improve the experience by both readers and authors. Please comment below.

Thanks to the folks who helped me sort this out on the TPRF Slack.

Cheers!

Let me count the ways (PWC 244 Count Smaller)

dev.to #perl

Published by Bob Lied on Tuesday 21 November 2023 18:04

TLDR

One pass over sorted data is a better strategy than searching through random data.

The Problem

Perl Weekly Challenge 244, Task 1, Count Smaller asks us to categorize data for its relative values:

You are given an array of integers. Write a 
script to calculate the number of integers 
smaller than the integer at each index.

Example 1

Input: @int = (8, 1, 2, 2, 3)
Output: (4, 0, 1, 1, 3)

For index = 0, count of elements less than 8 is 4.
For index = 1, count of elements less than 1 is 0.
For index = 2, count of elements less than 2 is 1.
For index = 3, count of elements less than 2 is 1.
For index = 4, count of elements less than 3 is 3.

Example 2

Input: @int = (6, 5, 4, 8)
Output: (2, 1, 0, 3)

Example 3

Input: @int = (2, 2, 2)
Output: (0, 0, 0)

Idea 1: Brute force search

The first idea, as usual, is brute force. For every element in the array, scan the array for values that are less than that. An optimization that immediately occurs to me is that the scan for smaller values would be easier if the numbers are sorted; we can quit early and don't have to scan the entire list every time.

sub countSmaller_A($nums)
{
    my @sorted = sort { $a <=> $b } $nums->@*;
    my @smaller = ();
    for my $i ( $nums->@* )
    {
        my $count = 0;
        for my $j ( @sorted )
        {
            last if $j >= $i;
            $count++
        }
        push @smaller, $count;
    }
    return \@smaller;
}

Searching in a sorted list has an optimization. We could find the index of the first element in @sorted that is greater than $i using binary search (or, more realistically, using List::Utils::bsearch_index because my odds of getting a binary search algorithm right are slim). Maybe I'll come back to this, but this is basically an O(n^2) algorithm, so there are probably better ideas to explore.

Idea 2: Frequency counts

The second approach is to count how many times each value occurs, saving a frequency table. Then select from that table all the lesser numbers and add them up. This is a bit of a Perl tour-de-force, using array operations up the wazoo. The code is compact, but the complexity might not be worth it.

sub countSmaller_B($nums)
{
    use List::Util qw/sum0/;
    my %freq;
    $freq{$_}++ for $nums->@*;

    return [ map { my $i = $_; sum0 @freq{ grep { $_ < $i } keys %freq } } $nums->@* ];
}

Building the frequency table is relatively obvious, but what's going on in that last line?

  • return [ ... ] -- the answer is going to be an array reference to the list of numbers
  • return [ map { my $i = $_; ... } $nums->@* ] -- the list of numbers is going to be generated by mapping each of the original numbers to its count of smaller numbers. Each of the original numbers is going to be assigned to $i while we're doing the transformation
  • grep { $_ < $i } keys %freq -- we're going to select all keys from the frequency table %freq where the key is less than the number we're looking at
  • @freq{ grep...} -- Using the list of keys from the grep, take a hash slice from the %freq table. This will give us the counts of each value less than $i.
  • sum0 @freq... -- The sum0 function adds up the values in an array, defaulting to 0 if the array is empty.

Idea 3: Make one pass over sorted data

Let's return for a moment to that sorted array we built back in Idea 1. Once the array is sorted, it's pretty easy to find all the smaller numbers -- it's a monotonically increasing sequence as we scan from left to right.

There are two complications: repeated values, and the fact that the answer has to be in the same order as the original array. Hashes for caches and hash slices are going to come to our rescue.

sub countSmaller_C($nums)
{
    my @sorted = sort { $a <=> $b } $nums->@*;

    my %smaller;
    my $lessCount = 0;
    while ( defined(my $i = shift @sorted) )
    {
        if ( ! exists $smaller{$i} )
        {
            $smaller{$i} = $lessCount;
        }
        $lessCount++
    }

    return [ @smaller{$nums->@*} ];
}

The first thing we do is take the hit of doing the sort, on the premise that we're going to get that performance back with a simpler search loop.

The %smaller variable is a hash that is going to contain our answer, but in an arbitrary order. We will un-arbitrary it at the end with a hash slice that uses the original array for keys -- that will solve our ordering problem.

The $lessCount variable is an accumulator that will count up the number of smaller values as we pass over the sorted array.

The while loop will take elements off the sorted array from left to right. We saw last week that shifting elements off the array can be more efficient than using array indexing. A quick note: the test has to include defined because there could be a zero in the data, and that would test as false.

Within the loop, we use the %smaller array as a cache for values we've already seen. That solves our repeated-values problem.

Time for benchmarking

This is only an exhibition; no wagering, please. As I've been doing for the past week, I brought out the Benchmark module for some simple comparison.

sub runBenchmark($repeat)
{
    use Benchmark qw/cmpthese/;
    my @data = map { int(rand(100)) } 1..100;

    cmpthese($repeat, {
        "simple   " => sub { countSmaller_A(\@data) },
        "frequency" => sub { countSmaller_B(\@data) },
        "one pass " => sub { countSmaller_C(\@data) },
    });
}

The benchmark generates some bigger data than task examples, and then runs the functions thousands of times to get something like a statistically valid result.

And here's the big reveal, sorted from slowest to fastest:

             Rate frequency simple    one pass 
frequency  1339/s        --      -63%      -95%
simple     3647/s      172%        --      -88%
one pass  29268/s     2085%      702%        --

First of all, those compact array operations in Idea 2 look cute, but there's a lot of data access going on underneath. We were better off with using more readable loops from Idea 1.
But, wow! Look at the one pass solution! Literally ten times faster. Better algorithms beat micro-optimizations.

Invitation to YAPC::Hiroshima 2024 in Japan

Perl Foundation News

Published by Makoto Nozaki on Monday 20 November 2023 22:42

Get ready for an unforgettable experience at one of the biggest Perl events in the world - YAPC::Hiroshima, organized by the Japan Perl Association.

📅 Event details

🚀 Why attend YAPC::HIroshima 2024?

  • Knowledge Exchange: Immerse yourself in Perl and non-Perl topics through three informative tracks of talks. They are expecting 300-400 attendees
  • Networking Opportunities: Connect with fellow Perl enthusiasts and developers
  • Keynotes and Guest Speakers: Engage with five distinguished guest speakers and participate in one keynote session

🎟️ Registration is Now Open

Reserve your spot at YAPC::Hiroshima 2024 by registering today. General admission is JPY 10,000 (approximately USD 70), with the option for individual sponsorship (additional JPY 10,000) and student discount (free).

Note all talks will be conducted in Japanese.

🗾 About Japan Perl Foundation

Japan Perl Association (JPA) is a non-profit organization based in Japan that focuses on promoting and supporting the Perl programming language within the country. The association is actively involved in organizing Perl events, conferences, and workshops targeting beginners (Perl Entrance).

Perl debugger compactDump on by default

dev.to #perl

Published by Bob Lied on Monday 20 November 2023 15:16

TLDR: sub afterinit { push @DB::typeahead, "o compactDump=1" }

When I use the Perl debugger, I usually want the compactDump option turned on. For reasons (?), I have never been able to set this option from the ~/.perldb file. It should be possible to set options by using lines like

...
parse_options("HistSize=100");
parse_options("compactDump=1");
...

but when I try that with compactDump, starting up the debugger gives me a lot of unsightly warnings:

[~/]$ perl -d  -wE 'say "what"'
Variable "$frame" is not imported at (eval 6)[/Users/lied/perl5/perlbrew/perls/perl-5.38.0/lib/5.38.0/perl5db.pl:7578] line 2.
Variable "$doret" is not imported at (eval 6)[/Users/lied/perl5/perlbrew/perls/perl-5.38.0/lib/5.38.0/perl5db.pl:7578] line 3.
perldb: couldn't parse ./.perldb: Global symbol "$frame" requires explicit package name (did you forget to declare "my $frame"?) at (eval 6)[/Users/lied/perl5/perlbrew/perls/perl-5.38.0/lib/5.38.0/perl5db.pl:7578] line 2.
Global symbol "$doret" requires explicit package name (did you forget to declare "my $doret"?) at (eval 6)[/Users/lied/perl5/perlbrew/perls/perl-5.38.0/lib/5.38.0/perl5db.pl:7578] line 3.

A close reading of some Stack Overflow articles and the perldoc perldebug documentation finally gave me a workaround. The following, added to ~/.perldb, will enable compactDump without the noise:

sub afterinit { push @DB::typeahead, "o compactDump=1" }

This assumes that we are using GNU readline, which, of course we are.

Reverse Pairs on the Floor

RabbitFarm Perl

Published on Sunday 19 November 2023 17:18

The examples used here are from the weekly challenge problem statement and demonstrate the working solution.

Part 1

You are given an array of integers. Write a script to return the number of reverse pairs in the given array.

Solution


use v5.38;
sub reverse_pairs{
    my @integers = @_;
    my @reverse_pairs;
    do{
        my $i = $_;
        do{
            my $j = $_;
            push @reverse_pairs, [$i, $j] if $integers[$i] > $integers[$j] + $integers[$j];
        } for $i + 1 .. @integers - 1;
    } for 0 .. @integers - 1;
    return 0 + @reverse_pairs;
}

MAIN:{
    say reverse_pairs 1, 3, 2, 3, 1;
    say reverse_pairs 2, 4, 3, 5, 1;
}

Sample Run


$ perl perl/ch-1.pl 
2
3

Notes

A reverse pair is a pair (i, j) where:

a) 0 <= i < j < nums.length 

and

b) nums[i] > 2 * nums[j].

I've been on a bit of a recursion kick recently, but I didn't have the appetite for it this week. A nested loop and we're done!

Part 2

You are given an array of positive integers (>=1). Write a script to return the floor sum.

Solution


use v5.38;
use POSIX;
sub floor_sum{
    my @integers = @_;
    my $floor_sum;
    do{
        my $i = $_;
        do{
            my $j = $_;
            $floor_sum += floor($integers[$i] / $integers[$j]);
        } for 0 .. @integers - 1;
    } for 0 .. @integers - 1;
    return $floor_sum;
}

MAIN:{
    say floor_sum 2, 5, 9;
    say floor_sum 7, 7, 7, 7, 7, 7, 7;
}

Sample Run


$ perl perl/ch-2.pl 
10
49

Notes

See above comment about not being as recursive this week!

References

Challenge 243

Horror Movie Month 2023

rjbs forgot what he was saying

Published by Ricardo Signes on Sunday 19 November 2023 15:35

Another year, another thirty-one days of horror movies. I’ve changed roles at work recently, which has led to a big dip in evening calls, which meant I was present for a lot more viewings. Excellent!

Also, I took this opportunity to start logging the things I watch in Letterboxd, at least until I get sick of it. My October 2023 diary will give you a bunch of the information in this blog post, but so far without any kind of rating or commentary. I also populated some, but not all, previous years’ horror movie months. I may get around to doing the rest, we’ll see.

Despite using Letterboxd for keeping my viewing diary, I think I’ll link to IMDB below. The web interface for Letterboxd’s cast lists is terrible, while the mobile one is just fine. This bugs me.

Okay, here we go!

October 1: The Advent Calendar (2021)

This has been in our list for a while. It’s got subtitles, so it’s been repeatedly bumped down in priority. Often, a horror movie is something we watch when we’re only partly present, and subtitles require more attention. Horror Movie Month can be a good time to catch up on these.

Anyway: a woman, paralyzed from the waist down, is given a creepy Advent calendar. Every day, when she eats the candy, something bad happens to somebody else. Often, something good happens to her. It’s Button, Button, sort of.

I thought it was pretty good, but the ending was annoyingly ambiguous. I get it, people love to make ambiguous endings, but I do not generally enjoy them. Or, maybe it’s: I enjoy when the filmmaker lets us imagine what the world is really like, but I don’t enjoy when we have to decide what the character would’ve done.

October 1: King on Screen (2022)

Two movies in one day! This was a documentary about the various adaptations of Stephen King’s writing into movies. I have a category of documentaries that are interesting, but don’t really change how I think about anything. This was in that category. I enjoyed it, but it was just a diversion. That’s fine!

It did give me the idea to make a big checklist of King adaptations and try to watch them all. Future project!

October 2: Sleepaway Camp Ⅲ: Teenage Wasteland (1989)

This movie is ridiculous, and I like it. Pamela Springsteen is weirdly great as the killer. Sleepaway Camp Ⅲ was filmed at the same time as Sleepaway Camp Ⅱ, so it’s nice to have some continuity of feeling. I think it represents a lot of what’s best in the goofy just-for-fun slashers. That said, it’s kind of not great. It’s just fun.

October 4: Terrified (2017)

We’d had this in our list for quite a while, and Gloria said she’d heard good things in some horror documentaries. It was pretty good. More subtitles! Basically, it was a haunted house. I remember a little bit of it, but not a whole lot. I think that means it was probably just fine.

October 5: The Blackening (2022)

We like a good horror comedy. This one, I think, was okay. I also think I wasn’t the target audience, so I’m not the right guy to ask. I liked the cast, and maybe I should look for them in some other things.

October 7: Messiah of Evil (1974)

Messiah of Evil made its way onto our to-watch list because it was on a “best overlooked horror movies” list, maybe on Polygon. It wasn’t good. It had a pretty weird vibe, which I appreciated. I didn’t really buy it was a critique of consumerism, or at least as an effective one. There are better Lovecraftian movies, better zombie movies, and better movies criticizing society.

But now I’ve seen one more cult classic.

October 8: V/H/S (2012)

When this movie came out, it felt like it was everywhere. It made a lot of best-of lists, and people talked about it was a breakthrough. Maybe I should’ve watched it ten years ago, but I am so, so burned out on shakycam. I want to see some found footage movie where all the footage comes from fixed cameras. Lots of security camera footage. Parked car dash cams. That kind of thing.

Anyway, an anthology movie is like a short story collection, and I like them both for the same reason: the good stories are good, and the bad ones are over soon. This had a couple good pieces and a couple bad ones, and I liked the good ones. I just wish they weren’t shakycam!

My main complaint is probably that the framing device didn’t end up tying things together enough. (If there’s no framing story, I do not require things tie together!) There are maybe five sequels to this, and I’m a little worried that it’s going to turn out that they keep pretending there’s some cool underlying story, but there won’t be.

I’m not sure I liked it enough to watch many of them, though.

October 9: Slumber Party Massacre (2021)

This is sort of a sequel to the 1982 Slumber Party Massacre. It was great.

The original was first written as a send-up of slasher movies and their misogyny, but during production was reworked to be a more traditional slasher. This movie brings back that stance. We see a bunch of shirtless guys having a pillow fight and spraying each other with beer. There’s a long, long scene of one guy showering.

It’s also fun as a goofy slasher movie with decent production values. I think I’d suggest watching the first two originals, then this one. (I have no recollection of the third movie!)

October 10: Ma (2019)

Octavia Spencer (great as always) plays a “just kinda off” woman who starts helping a bunch of teenagers buy booze, and to have a place drink it. Thing is, she’s just kinda off. The movie takes a couple left turns. It was probably one of the better things we watched, and I recommend it.

October 11: Talk to Me (2022)

This was on a few “best of 2022” lists, and I’d seen a trailer at some point in the past that looked good. Despite the previous exposure, I somehow hadn’t realized it was an Australian movie until it was playing and I heard the accents. Woah.

Premise: there’s a ceramic hand, and when you hold it and say the magic words, you see a ghost, and you can let them possess your body. This gets used as a party trick by stupid teenagers, because stupid teenagers are stupid. “You can’t hold it for more than ninety seconds”, but somebody does.

It was good!

October 13: Victor Crowley (2017)

This is just Hatchet Ⅳ. It wasn’t great. I liked some of its ideas, especially the “trapped in a crashed plane” bit. Mostly, though, it just wasn’t good. I still like seeing Kane Hodder get work, and I liked Parry Shen.

I’d give it a pass.

October 14: Totally Killer (2023)

Look, this wasn’t a masterpiece, but it was a lot of fun, and if you think you might enjoy it, I think you probably will. Thirty years after 1980s slasher event, the child of the survivor girl goes back to that era and tries to prevent the whole massacre.

It’s a little bit Happy Death Day, a little bit Back to the Future. Just my cup of tea.

October 14: V/H/S/2 (2013)

Well, despite not loving V/H/S, we decided to watch the first sequel. Like the first one, it had its moments, but it wasn’t great. Some of the short films in it were good, though. How about somebody makes a new V/H/S movie that’s just the best shorts?

I am not sure I will watch any more of these.

October 15: Spirit Halloween: The Movie (2022)

Look, I knew this movie would not be great, but I hoped it would be fun. It was occasionally fun, but not worth the time.

A movie based on and partly funded by a retail chain wasn’t great. Who could’ve guessed?

October 16: Christine (1983)

I’ve seen Christine before, but I wanted to see it again, especially after watching the King on Screen documentary. It was still really good. It’s very of its time, but in a good way. I had forgotten how good the cast was! Keith Gordon, as Arnie, is just terrific. The rest of the cast was great, too, and I especially liked Robert Prosky as Darnell, the foul-mouthed owner of the garage where Arnie repairs Christine.

Also? Great music.

October 17: Dead Ringers (1988)

I really like David Cronenberg, and this is one of the few movies of his that I hadn’t watched yet. I also like Jeremy Irons. How could it not be great?

Well, it was great! I feel like maybe someday I’ll watch it again and get even more out of it. For now, though, I just thought it was a really well-told story. (At one point, I said “there’s not a lot of Cronenberg stuff in this!” Thirty seconds later, Dr. Mantle brought out his “surgical tools for working on mutant women.” So, there was still some.)

October 18: Chopping Mall (1986)

When I was a kid, we went to Blockbuster Video all the time. We never got horror movies, but some of the boxes stuck with me. This was one of them. I’d seen it before. It wasn’t great, but I enjoyed it. It’s by Jim Wynorski, one-time king of exploitation movies (and sometimes soft-core pornography).

It’s the ’80s, some young people decide to stay in the mall’s mattress store overnight. The mall has recently rolled out security robots. Lightning strikes the mall and the robots become murderous. You can imagine a lot of what happens from there on out.

October 22: The Angry Black Girl and Her Monster

This is a telling of the Frankenstein story, built around themes of systemic racism and cycles of violence. It was good, and I enjoyed it, but I wish it had been a miniseries. I felt there wasn’t enough time to get a good sense of the characters, setting, and relationships. Great cast, and I was reminded how good Chad L. Coleman is.

October 22: Frankenhooker (1990)

I really like Frank Henenlotter. The Basket Case movies are weirdly great. Frankenhooker, too, is great, but in a very specific and weird way. It’s a good exploitation film about an electrician who is an amateur doctor and would-be Frankenstein. When his girlfriend dies, he wants to bring her back, but he needs body parts, so he goes looking for bodies. Also, he creates “super crack” to entice people.

The best thing about this movie is the north Jersey accents.

October 24: The Exorcist: Believer (2023)

Deeply meh. I didn’t care about almost any character in this, and I felt like its weird ecumenical approach to the exorcism was less, not more interesting than the very Roman Catholic one of previous movies.

Leslie Odom Jr. was great, though. No matter how much I didn’t care about anything else, I cared about his character, because anything that guy said, I took seriously. I should find out what else he’s done, beyond the obvious.

October 25: Bride of Chucky (1998)

This movie is stupid and I love it. It really leans into the ridiculousness of the original Child’s Play premise and has no shame about it, and that’s just what I want in a movie like this. Also, Brad Dourif and Jennifer Tilly are great.

I think Cult of Chucky remains my favorite Child’s Play movie, but this one is up there. (This was my second time watching this one.)

October 26: Misery (1990)

I saw this movie when it was new in the theater. It’s still great. Rob Reiner is such a good filmmaker, and across so many genres! It’s basically a two-hander, although some of the small secondary roles are great. (The sheriff!) James Caan is good, but Kathy Bates! Her Annie Wilkes is, to me, one of the all time scariest movie characters.

October 27: Terrifier (2017)

There’s a killer clown who never speaks, but he does do a buch of murder. It’s set in a nameless city that I choose to believe is Jersey City. I was pretty torn on this one. I appreciated the “Why? Because I said so, that’s why” nature of things. The movie did not need to explain anything to you, and didn’t make bones about it. I also thought David Howard Thornton did a really good job of being a creepy clown with a great range of clownish expressions. In the end, though, it just wasn’t great. I’m not sure I’ll watch the other movies in the franchise.

October 28: Death Spa (1988)

Shudder recommended this as a cult classic. I thought it was great (but terrible), and a real gem of the 1980s “weird bad stuff happens, and the justification can come next.” People attending a new fitness center keep dying. The script mostly makes sense, if you don’t look too hard. There are a half dozen possible causes of the death, including both ghosts and computer error. Somebody gets killed by using a pec fly machine, and I think it’s because he has somehow strapped his arms into it?

Anyway, it was very stupid and I liked it a lot.

October 29: Possum (2018)

The synopsis for this movie includes the phrase “a disgraced children’s puppeteer”, which starts things on a pretty weird note.

It’s a strange movie, and I don’t think it’s right to think of it as a horror movie in the same sense as so many other things on this list. It’s a psychological horror story about a man who has had a difficult life and now comes home to the absolute disaster of a house he grew up in. It’s very slow paced and deliberate. I did like it, but I’m not sure who I’d recommend it to. I think I liked it more because it was committed to being what it was, more than because it was extremely effective.

October 30: The Autopsy of Jane Doe (2016)

This was my second time watching this movie, which I remembered in part, but also was clearly mixing up with The Void in my memory. It was good. Brian Cox and Emile Hirsch play father and son coroners who are brought a really weird body to examine. It’s late at night, there’s a storm coming in, and as the night drags on, things get weirder and weirder. I thought it struck a really good tone, and the guys try to stick to “everything can be explained” until they finally say, “let’s just get the hell out of here”. Also, I thought it ended well, which a movie like this could easily fail to do.

October 31: A Haunting in Venice (2023)

Only barely a horror movie, here at the end. We have been skeptical of Kenneth Branagh as Poirot, as we’re big fans of David Suchet’s long run as the detective. Still, this one looked fun, and we’d heard good things. Our verdict: it was okay. Branagh was fine, but no Suchet. It was a little too dark — like, the lighting. There were some weird plot holes. Still, it was just fine. I’m not in a rush to watch the other Branagh Poirot movies yet.

Other Stuff

Above, not every day in October is listed. We also watched the fourth season of Creepshow, which was okay. (We enjoy Creepshow, even when it’s not great.) Sometimes I think there are only one or two good episodes, but it’s just fun even when it’s bad. I like its attitude.

We also watched The Horror of Dolores Roach. It’s a spin on Sweeney Todd, with Justina Machado as the Todd role. She kills people and her friend makes them into empanadas. It was good, with a balance of tension and comedy. The framing device was weird, but worked. I’m not sure what I think about the implication that there will be another season, but I liked the one we got.

I’m sure between now and October 2024, we’ll watch lots of horror movies, but probably I won’t write about any of them, and you’ll have to wait until then. We do have a few things queued up for Christmas, though. Also, finally we get a new Thanksgiving horror movie this year: Thanksgiving. There really aren’t enough of those.

(cdlxx) 10 great CPAN modules released last week

Niceperl

Published by Unknown on Saturday 18 November 2023 22:03

Updates for great CPAN modules released last week. A module is considered great if its favorites count is greater or equal than 12.

  1. App::Netdisco - An open source web-based network management tool.
    • Version: 2.070001 on 2023-11-15, with 16 votes
    • Previous CPAN version: 2.068001 was 14 days before
    • Author: OLIVER
  2. DBM::Deep - A pure perl multi-level hash/array DBM that supports transactions
    • Version: 2.0019 on 2023-11-12, with 28 votes
    • Previous CPAN version: 2.0018 was 4 days before
    • Author: DCANTRELL
  3. Firefox::Marionette - Automate the Firefox browser with the Marionette protocol
    • Version: 1.49 on 2023-11-18, with 14 votes
    • Previous CPAN version: 0.77 was 4 years, 4 months, 11 days before
    • Author: DDICK
  4. Git::Hooks - Framework for implementing Git (and Gerrit) hooks
    • Version: 3.6.0 on 2023-11-16, with 12 votes
    • Previous CPAN version: 3.5.0 was 9 months, 8 days before
    • Author: GNUSTAVO
  5. Imager - Perl extension for Generating 24 bit Images
    • Version: 1.020 on 2023-11-12, with 62 votes
    • Previous CPAN version: 1.019 was 1 year, 4 months, 3 days before
    • Author: TONYC
  6. Math::BigInt - Pure Perl module to test Math::BigInt with scalars
    • Version: 2.001000 on 2023-11-13, with 13 votes
    • Previous CPAN version: 2.000000 was 13 days before
    • Author: PJACKLAM
  7. Object::Pad - a simple syntax for lexical field-based objects
    • Version: 0.806 on 2023-11-14, with 41 votes
    • Previous CPAN version: 0.805 was 25 days before
    • Author: PEVANS
  8. Regexp::Debugger - Visually debug regexes in-place
    • Version: 0.002007 on 2023-11-18, with 55 votes
    • Previous CPAN version: 0.002006 was 3 years, 2 months, 6 days before
    • Author: DCONWAY
  9. SPVM - SPVM Language
    • Version: 0.989061 on 2023-11-14, with 31 votes
    • Previous CPAN version: 0.989060 was 4 days before
    • Author: KIMOTO
  10. Sys::Virt - libvirt Perl API
    • Version: v9.8.0 on 2023-11-15, with 17 votes
    • Previous CPAN version: v9.7.0 was 2 months, 8 days before
    • Author: DANBERR

(dlxxii) metacpan weekly report

Niceperl

Published by Unknown on Saturday 18 November 2023 22:01

This is the weekly favourites list of CPAN distributions. Votes count: 41

This week there isn't any remarkable distribution

Build date: 2023/11/18 21:00:04 GMT


Clicked for first time:


Increasing its reputation:

My Programming Language is More Terse Than Yours

Perl on Medium

Published by Khun Yee Fung, Ph.D. on Saturday 18 November 2023 20:18

My usual retort is: “so what?”

Fosdem mini grants

Perl Foundation News

Published by Amber Krawczyk on Friday 17 November 2023 14:01

One of the goals TPRF would like to achieve, now that conferences are becoming increasingly available in person, is to spread awareness of current Perl and Raku projects.

In support of this goal, TPRF will be issuing a limited number of mini grants of up to $300 to participants interested in holding Perl/Raku based talks in TPRF's FOSDEM 2024 dev room.

In addition, TPRF will have a 2 day stand at FOSDEM and are in need of volunteers to staff it. Stand volunteers are also eligible to apply for a mini grant of up to $300 to assist with the cost of attending.

To apply for a FOSDEM mini grant, please send a completed application to fosdem2024-grants@perlfoundation.org or send it to Amber Krawczyk on the TPRF slack.

If you have questions, please join our fosdem slack channel, leave a comment below, or send a message to hello@perlfoundation.org

FOSDEM 2024, call for participation

Perl Foundation News

Published by Amber Krawczyk on Tuesday 14 November 2023 22:48

==================================

The Perl and Raku Foundation is thrilled to announce that the FOSDEM organising team has accepted our proposal to set up a DevRoom on Saturday, February 3rd 2024. It has been quite a few years since the last Perl DevRoom at FOSDEM. Historically, they have always been well attended and packed.

Time for an Update

Since last time, a lot has happened, and TPRF is excited to help create this venue for sharing news with developers from Europe and across the globe. Many FOSDEM visitors have a background using Perl, but may have missed out on recent developments. Larry Wall himself was a guest speaker at FOSDEM in 2015 to announce Perl 6, which was later renamed to Raku. Much has happened since then, and there is lots to share!

Participation

TPRF would like to offer contributors to Perl, Raku, their ecosystems and modules, or any other FOSS projects the opportunity to participate at this exciting annual event in Brussels. The TPRF-FOSDEM organisers are specifically looking for anyone with a compelling story to share about their Open Source project that has a strong background in Raku or Perl.

Do you have something fascinating or new to share with the Perl and Raku communities?

Then do not hesitate to submit your presentation proposal. Visit the FOSDEM 2024 Pretalx website and fill in the form. There is a limited availability for speakers to give a 20 minute engaging presentation.

Deadline for submissions is December 1st, 2023.

About FOSDEM

FOSDEM is a two day, free event for software developers to meet, share ideas, and collaborate. Every year, thousands of developers of free and open source software from all over the world gather at this annual event in Brussels.

FOSDEM 2024 will take place on Saturday 3 and Sunday 4 February 2024. It will be an in-person event at the ULB Solbosch Campus, Brussels, Belgium, Europe.

FOSDEM 2024 website

About The Perl and Raku Foundation

TPRF is dedicated to the advancement of the Perl and Raku programming languages, through open discussions, collaboration, design, and code. The Perl and Raku Foundation's desire is to build a strong, healthy and sustainable language ecosystem and community. The TPRF grant programs help fund development of open source projects to benefit Perl, Raku and the broader community. The foundation helps to sponsor many events, worldwide, each year. Open source development depends on events like FOSDEM, which allow developers to come together in person and share ideas, code, and have fun.

The Perl and Raku Foundation website Call for Participation 2024.md Displaying Call for Participation 2024.md.

Missing Flips

RabbitFarm Perl

Published on Saturday 11 November 2023 21:43

The examples used here are from the weekly challenge problem statement and demonstrate the working solution.

Part 1

You are given two arrays of integers. Write a script to find out the missing members in each other arrays.

Solution


use v5.38;
use boolean;
use Data::Dump q/pp/;
sub missing_members{
    my @r;
    my($a0, $a1) = @_;
    my $missing0 = [];
    missing_members_r([@{$a0}], [@{$a1}], $missing0);
    my $missing1 = [];
    missing_members_r([@{$a1}], [@{$a0}], $missing1);
    push @r, $missing0 if @{$missing0} > 0;
    push @r, $missing1 if @{$missing1} > 0;
    return @r;
}

sub missing_members_r{
    my($a0, $a1, $missing, $seen) = @_;
    $seen = [] if !defined($seen);
    my $x = shift @{$a0};
    push @{$missing}, $x if missing_r($x, [@{$a1}]) && !seen_r($x, $seen); 
    push @{$seen}, $x;
    missing_members_r($a0, $a1, $missing, $seen) if @{$a0} > 0;
}

sub missing_r{
    my($x, $a0) = @_;
    return true if @{$a0} == 0;
    if(@{$a0}){
        my $y = shift @{$a0};
        if($x == $y){ 
            return false;
        }
    }
    return missing_r($x, $a0);
}

sub seen_r{
    my($x, $seen) = @_;
    return false if @{$seen} == 0;
    my $y = shift @{$seen};
    if($x == $y){
        return true;
    }
    return seen_r($x, $seen);
}

MAIN:{
    my @array1 = (1, 2, 3);
    my @array2 = (2, 4, 6);
    say pp missing_members \@array1, \@array2;
    @array1 = (1, 2, 3, 3);
    @array2 = (1, 1, 2, 2);
    say pp missing_members \@array1, \@array2;
}

Sample Run


$ perl perl/ch-1.pl 
([1, 3], [4, 6])
[3]

Notes

So, yeah, this could just be a nice quick use of grep, but where is the fun in that!?!? Just looping over the arrays is not that exciting of an alternative, what other options are there? I know, how about a whole lot of recursion! That was pretty much my thought process here.

Really, all this code is doing is looping over the two arrays and looking for which elements are not contained in each. The looping, such as it is, happens recursively in missing_members_r() and missing_r(). Duplicates are possible and we avoid these, again recursively, using seen_r() rather than, say, grep or hash keys.

Part 2

You are given n x n binary matrix. Write a script to flip the given matrix as below.

Solution


use v5.38;
use Data::Dump q/pp/;
sub flip_matrix{
    return map { 
        my $row = $_;
        [map {~$_ & 1} reverse @{$row}]
    } @_;
}

MAIN:{
    my @matrix = ([1, 1, 0], [1, 0, 1], [0, 0, 0]);
    say pp flip_matrix @matrix;
    @matrix = ([1, 1, 0, 0], [1, 0, 0, 1], [0, 1, 1, 1], [1, 0, 1, 0]);
    say pp flip_matrix @matrix;
}

Sample Run


$ perl perl/ch-2.pl 
([1, 0, 0], [0, 1, 0], [1, 1, 1])
([1, 1, 0, 0], [0, 1, 1, 0], [0, 0, 0, 1], [1, 0, 1, 0])

Notes

After all the recursive exitment in part 1 of this week's challenge I just went with a quick nested map for part 2.

References

Challenge 242

(cdlxix) 11 great CPAN modules released last week

Niceperl

Published by Unknown on Saturday 11 November 2023 22:00

Updates for great CPAN modules released last week. A module is considered great if its favorites count is greater or equal than 12.

  1. Catmandu - a data toolkit
    • Version: 1.2021 on 2023-11-06, with 22 votes
    • Previous CPAN version: 1.2020 was 8 months, 26 days before
    • Author: HOCHSTEN
  2. DateTime - A date and time object for Perl
    • Version: 1.65 on 2023-11-06, with 211 votes
    • Previous CPAN version: 1.63 was 15 days before
    • Author: DROLSKY
  3. DBM::Deep - A pure perl multi-level hash/array DBM that supports transactions
    • Version: 2.0018 on 2023-11-08, with 28 votes
    • Previous CPAN version: 2.0017 was 2 months, 10 days before
    • Author: DCANTRELL
  4. Encode - character encodings in Perl
    • Version: 3.20 on 2023-11-10, with 59 votes
    • Previous CPAN version: 3.19 was 1 year, 3 months, 6 days before
    • Author: DANKOGAI
  5. Getopt::Long - Module to handle parsing command line options
    • Version: 2.57 on 2023-11-11, with 119 votes
    • Previous CPAN version: 2.54 was 11 months, 24 days before
    • Author: JV
  6. IO::Socket::SSL - Nearly transparent SSL encapsulation for IO::Socket::INET.
    • Version: 2.084 on 2023-11-06, with 47 votes
    • Previous CPAN version: 2.083 was 5 months, 19 days before
    • Author: SULLR
  7. Minion - Job queue
    • Version: 10.26 on 2023-11-10, with 102 votes
    • Previous CPAN version: 10.25 was 1 year, 4 months, 16 days before
    • Author: SRI
  8. Module::ScanDeps - Recursively scan Perl code for dependencies
    • Version: 1.35 on 2023-11-05, with 15 votes
    • Previous CPAN version: 1.34 was 1 month, 11 days before
    • Author: RSCHUPP
  9. Spreadsheet::Read - Meta-Wrapper for reading spreadsheet data
    • Version: 0.88 on 2023-11-07, with 30 votes
    • Previous CPAN version: 0.87 was 8 months, 13 days before
    • Author: HMBRAND
  10. SPVM - SPVM Language
    • Version: 0.989060 on 2023-11-10, with 31 votes
    • Previous CPAN version: 0.989058 was 10 days before
    • Author: KIMOTO
  11. YAML::PP - YAML 1.2 Processor
    • Version: v0.37.0 on 2023-11-09, with 15 votes
    • Previous CPAN version: 0.036 was 5 months, 30 days before
    • Author: TINITA

Agile Sucks

Personal blog of Bigfoot (Perl & Tech)

Published on Wednesday 08 November 2023 18:54

I’m So Done With Agile

Every development project ultimately has a goal of providing some kind of value to the organization that has decided to initiate a software development project.

The bottom line of any software development project is the bottom line. Does the cost of the project AND the maintenance of the project create a profit?

I know what you are thinking. Not all software applications are designed to produce profit. Untrue. Even applications we call “internal” create value or contribute to the creation of value.

What is Failure?

Let’s talk about and characterize failure first. Because its much easier to define (as anyone who has had the misfortune of working with a product development team that cannot define “done” knows). And I’ve been told that that most software development projects fail.

  1. The project is canceled.

    This is the “first order broke” condition of projects. It took too long, it went over budget and looked to continue to be a money pit (someone understood the fallacy of sunk costs), the environment changed making the application moot or a new CEO decided to replace all internal applications with some SaaS, PaaS, or his own pet project.

  2. The application was launched and did not meet the goals of the project.

    This can mean a lot of things: the project does not solve enough of the business problems to justify the continued cost of maintenance. Or perhaps the application did not generate enough revenue to justify its existence because of poor market acceptance. People just hate using it.

  3. The project is in use, people use it, but the ROI is too far in the future or perhaps indeterminate.

    The project becomes a drag on the organization. No one wants to pull the plug because they have no alternative (or believe they don’t). There’s no appetite to rewrite, refactor or reimagine the application. It becomes a huge boat anchor that a handful of engineers keep running by kicking it in the ass whenever it stalls.

What is Success?

  1. The project launches on time and under budget.

    Keep in mind that this is (mostly) a necesasry, but insufficient condition for success. Yes, there are some successful projects that are over budget or late, but its sort of like starting Monopoly owing everyone money. You need to catch up and catch up fast.

  2. The application completely solves the business problem.

    Again, a necessary but insufficient condition for success. If the application is difficult to maintain and requires constant attention that costs more than it saves or produces, it’s not a success.

  3. The application just works

    …and is a critical component in a complex workflow - without it nothing else would - its cost to develop and maintain is easily justified by the the nature of its job. It successfully completes its mission every single day.

This Was About Agile Right?

Oh yeah, Agile. I read articles about Agile and people’s experience with it all the time. I suspect most opinions are based on few data points and mostly from one person’s negative (or rarely positive) experience with Agile. My opinions (and that’s all they are…YMMV) are based on working with some fairly large clients that I am not at liberty to divulge. One FANG, one Fortune 50 company, one major manufacturer of phones and multiple companies with more than 5000 employees. I’m not opining based on one ride on the merry-go-round. I’m the kind of person that always believes that I just don’t get it, and I need to learn more, read more and accept more to overcome my ignorance and lack of experience. It’s a viewpoint that has allowed me to grow in my career and learn a lot of very useful things that have conspired to make me, if not wealthy, not concerned about money.

I am now having a lot fun going back to my roots of being a software developer. While I have been on the management side of projects employing the Agile process I am now in the belly of the beast. It smells bad, feels wrong and kills productivity. But, again, YMMV.

Why Does Agile Suck?

  1. Product Owners - All “product owners” are not created equal. They have varying degrees of understanding of their own domain. Some even believe developers have ESP. To be fair, some expect developers (and rightly so) to “ask questions”. The problem is, what happens when the developer does not understand the domain. What questions should they ask? They are clueless.

    Product owners should assume nothing (in my opinion) and determine the level of domain expertise developers have. It is their responsibility to make that assessment - if they don’t they must be explicit with requirements, otherwise you’ll almost certainly end up with a project or feature that does not meet your needs.

  2. Scrum Masters - are generally useless. The Vanna White’s of software development. I’d almos say Vanna had a harder job. Turning letters that have been lit up for you puts a lot of pressure on you to turn the “right” letter.
  3. Ceremonies - Most developers hate meetings. There is of course the rare “meeting moth” that has decided it is easier to pontificate, hash things out, and “parking lot” ideas than actually code. But let’s talk about the programmers we all know and love. Leave them alone with a problem and some good requirements, decent tools and they’ll produce something for you. Developers generally loathe people. To hold meetings apparently you need to round some people up and torture them for 30 to 45 minutes every day. Oh, so let’s make “stand-ups”! We’ll cap them at 15 minutes and 20 people will get a fraction of a minute to recap what they did yesterday. Only there’s that one guy. Yeah, you know who you are. You think we care about your busy day and the fact that you worked through the night solving problems you created? Nope. Please, please, continue babbling so the time runs out on this farce!
  4. Pointing - Sadly, there’s a poor Italian mathematician turning over in his grave as we speak. His claim to fame usurped by idiots who use numbers without understanding what they represent or the context for their use. That’s right - points mean diddlysquat. I’ve seen them used for billing by the scammy outsourcing companies that point their own stories and then bill accordingly. Or there is the pointing that uses them to determine how much “work” someone can do in 2 weeks. Ha! Gotcha! I’m pointing everying as 13! Is that Fibonacci?
  5. Retrospectives - Fuck that shit. Let’s just do the Festivis pole, air our list of grievances and then proceed to the feats of strength. It would be more useful and of course highly entertaining. Hoochie Mama!
  6. Sprints - We don’t know where we’re going but let’s sprint there! Isn’t that the irony of Agile? We don’t know wtf the requirements are until we start coding (according to some people’s definition of Agile) and yet we want to get it done quickly. It’s like watching my 3 year old son on his Big Wheel motoring down the street careening off of curbs and smashing this absolute wonder of plastic technology into my neighbors bushes. No one is seriously hurt, it’s a bit amusing but we really haven’t gotten anywhere.

So, here’s the bottom line. Any idea worth something greater than 0 that also has a wee bit of marketing behind it quickly becomes an opportunity for gypsies, tramps and thieves to exploit the ignorant masses. Take Christianity for example. Need I say more? Agile has become the Chrisitianity of corporate America. No one dare mention that is doesn’t solve our problems or make us feel any better. Fuck Agile, the ceremonies, the training, the roles the practice…it is the most unproductive enviroment one can devise for developing software. Look it up…Bill Gates wrote an entire BASIC interpreter and shoved it into 4K of a ROM. He then worked on a 32K version that was essentially a complete OS. He didn’t need Agile to do that.

So, let’s be clear. Agile is social engineering. An attempt to organize human beings in order to create something that no one of them could do alone (or so it goes). Somehow I don’t think Agile works. Some will say, yeah, well not every project should use Agile. Yes, that’s true, but the sad fact is that corporate America is not nuanced. They are binary. They want single solutions to complex problems and do not want to hear…it depends. And so they consume the entire bottle of aspirin.

There will be a day when people look back at the unproductive, waste and utter insansity that is “Agile”. They will marvel at the way that a single, possibly good idea for some things, was transformed into a dogma that haunted software development for a decade.

I’m hopeful however that really smart companies know that instituting things like Agile are the bellweather of their demise. They will avoid trying to fit round pegs into square holes. They will embrace the idea that you can plan things properly, but plans can change without embracing a chaotic, highly disorganized process that actually masquerades as a structured protocol.

You have been warned. When some consultant you hire to justify the outsourcing of your development team says that they can replace your current processes with an Agile team from Elbonia and a scrum master from Bumblefuck…be afraid…be very afraid. There is no free lunch.

One final thought…why is software development so hard? And why do we struggle so to create applications?

It’s not a hard question actually. The goal of software development is to codify a solution to a problem. But first…and here is the reveal…you have to define the problem. That is, in and of itself the most difficult thing in the development process. Missed requirements are, in my experience, the biggest reason for “re-work”. Note I did not say “bugs” or “defects”. Most maintenance on systems is because of missed requirements, not because programmers make mistakes. Oh, for sure, they do. But really? Think. Look back at your tickets and do a root cause analysis.

There are other reasons software development is hard. First, people do not communicate well. The do not communicate precisely and they do not communicate accurately. Next, the tools to express the solutions to our problems are complex and incomplete. Better ingredients make better pizzas. Papa Johns!

Okay, I have to wrap this up…Agile sucks. I hate Agile. I want to mute myself when I’m in stand-ups just to say every day “Oh, I was on mute.” and torture everyone that thinks this ceremony is useful.

Oh,I’m having issues with my internet so I may have to drop soon….open the pod bay doors Hal?

Understanding the Basics of Perl for Text Processing with AI Features

Perl on Medium

Published by Staney Joseph ️ on Monday 06 November 2023 03:22

Perl, a high-level, general-purpose, interpreted, dynamic programming language, has been an industry staple since its creation in 1987…

Recursive Loops and Code Re-Use

RabbitFarm Perl

Published on Sunday 05 November 2023 18:19

The examples used here are from the weekly challenge problem statement and demonstrate the working solution.

Part 1

You are given an array (3 or more members) of integers in increasing order and a positive integer. Write a script to find out the number of unique Arithmetic Triplets satisfying the given rules.

Solution


use v5.38;
sub arithmetic_triplets{
    my $counter = 0;
    my $difference = shift;
    arithmetic_triplets_r($difference, \$counter, [@_[0 .. @_ -1]], [@_[1 .. @_ -1]], [@_[2 .. @_ -1]]);   
    return $counter;
} 

sub arithmetic_triplets_r{
    my $difference = $_[0]; 
    my $counter = $_[1]; 
    my @i = @{$_[2]};         
    my @j = @{$_[3]};         
    my @k = @{$_[4]};        
    if(@i > 0 && @j > 0 && @k > 0){
        $$counter++ if $j[0] - $i[0] == $difference && $k[0] - $j[0] == $difference;   
        arithmetic_triplets_r($difference, $counter, [@i], [@j], [@k[1 .. @k - 1]]);   
    }
    elsif(@i > 0 && @k == 0 && @j > 0){
        arithmetic_triplets_r($difference, $counter, [@i], [@j[1 .. @j - 1]], [@j[2 .. @j - 1]]);   
    }
    elsif(@i > 0 && @k == 0 && @j == 0){
        arithmetic_triplets_r($difference, $counter, [@i[1 .. @i - 1]], [@i[2 .. @i - 1]], [@i[3 .. @i - 1]]);   
    }
}

MAIN:{
    my $difference;
    $difference = 3;
    say arithmetic_triplets $difference, 0, 1, 4, 6, 7, 10;
    $difference = 2;
    say arithmetic_triplets $difference, 4, 5, 6, 7, 8, 9;  
}

Sample Run


$ perl perl/ch-1.pl 
2
2

Notes

The rules for arithmetic triples are a) i < j < k b) nums[j] - nums[i] == diff and c) nums[k] - nums[j] == diff, where diff is a provided parameter. The code above implements these rules somewhat in the obvious way, looping thricely over the list, but recursively.

Part 2

You are given an array of unique positive integers greater than 2. Write a script to sort them in ascending order of the count of their prime factors, tie-breaking by ascending value.

Solution


use v5.38;
sub prime_factor{
    my $x = shift(@_); 
    my @factors;    
    for (my $y = 2; $y <= $x; $y++){
        next if $x % $y;
        $x /= $y;
        push @factors, $y;
        redo;
    }
    return @factors;  
}

sub prime_order{
    my %factor_i = map{($_, 0 + prime_factor($_))} @_;
    my $factor_sorter = sub{
        my $c = $factor_i{$a} <=> $factor_i{$b};
        return $c unless !$c;
        return $a <=> $b;
    };
    return sort $factor_sorter @_;
}

MAIN:{
     say join q/, /, prime_order 11, 8, 27, 4;
}

Sample Run


$ perl perl/ch-2.pl 
11, 4, 8, 27

Notes

This code borrows from two previous challenges: The prime factor code has been used several times, but in this case I referred to the Attractive Number challenge from TWC 041. The sorting is a variant of the frequency sort from TWC 233. If you write enough code you don't need GitHub Copilot, you can just re-use your own work!

References

Challenge 241

Maintaining Perl (Tony Cook) September 2023

Perl Foundation News

Published by alh on Thursday 02 November 2023 14:02


Tony writes:

``` [Hours] [Activity] 2023/09/04 Monday 0.13 github notifications 0.40 #21421 fix some noise from G_USEHINTS tests 1.03 #21419 thinking, comment 1.55 #21449 review and approve 1.02 look into AIX smoke failures, find at least one problem,

fix it, push for CI

4.13

2023/09/05 Tuesday 0.38 email George Greer about mingw smoke failures 1.75 look into fedora smoke failure, reproduce, just #20812 0.27 #21451 apply to blead and perldelta

0.70 #20812 work up a possible fix, push for CI

3.10

2023/09/06 Wednesday 0.60 #20812 some changes, push for CI 0.05 #21454 review and approve 0.10 #21405 review and approve 1.00 #21367 review, research, approve and comment 0.47 security list discussion: research, comment 0.10 #21418 review and apply to blead 0.87 #21422 review and comment

0.38 #21446 review and approve

3.57

2023/09/07 Thursday 0.90 #20812 updates 0.17 #21442 review updates and approve 1.40 #21426 review and approve 0.23 #21404 review and comment 0.40 security list follow up

1.02 #21460 research, comment

4.12

2023/09/11 Monday 0.78 security list discussion, research, updates 0.47 #21367 apply to blead, perldelta 0.17 #21463 re-check, apply to blead 0.75 #21419 review new changes, comment 0.37 EU::CB: follow up on mail from AMBS to p5p

1.78 #21467 review and comment

4.32

2023/09/12 Tuesday 0.23 #21419 review latest changes and approve 1.13 #21467 review latest changes

0.05 #21467 continue review and approve

1.41

2023/09/13 Wednesday 0.82 #21450 review, research and comment 0.35 #21469 review and approve 1.03 #21468 review, look at smoke results, testing and comment 0.27 #21470 review and approve 0.18 #21471 review and approve 0.10 #21472 review and approve 0.12 #21474 review and approve 0.25 #21475 review and approve 0.37 #21468 testing and comment

2.20 #19370 work on a test, do the revert fix other tests

5.69

2023/09/14 Thursday 0.37 github notifications 1.77 #19370 work out failing test, more testing, minor fixes, push for CI

0.97 #21468 test updates testing, look over commit

3.11

2023/09/15 Friday 0.22 #21457 apply to blead, perldelta

0.35 #19370 look into CI failures, non-threaded fixes

0.57

2023/09/18 Monday 0.60 #21488 review, comments 0.73 #21481 review, comment 1.90 #21458 review discussion, review PR 21484, testing, comments 0.25 #21476 review and approve 0.20 #21482 review and approve 0.57 #19370 check CI results, make PR 21489

0.40 check coverity fixes CI results, make PR 21490

4.65

2023/09/19 Tuesday 0.68 #21484 more testing, comment 1.23 #21490 look over comment, research and add an additional commit 0.25 #21403 review, research and approve 0.12 #21429 review and approve 1.53 #21486 try working up an op_free() inline patch, try

profiling and approve

3.81

2023/09/20 Wednesday 0.33 #21481 review and approve 0.10 #21488 review and approve 0.57 #21473 review, testing and comment 1.90 #16971 work up a fix for the basic issue, try to get other similar split()s to crash 0.17 #16971 clean up, push for CI

0.45 #17029 testing, write some documentation and push for CI

3.52

2023/09/21 Thursday 0.50 #21498 struggle with github’s diff between latin-1 and utf- 8 encoded versions of file and comment 0.18 #21473 follow-up comment 2.23 #21458 try a clever approach, and get the ticket regression tests to pass, but unfortunately other tests fail 2.05 #21458 try the boring approach, add more tests, testing,

extra fixes, push for CI, make PR 21502

4.96

2023/09/25 Monday 1.05 #20917 rebase and push for CI 0.10 #21490 apply to blead 0.10 #21503 apply to blead 0.12 #21489 apply to blead 0.93 #20810 testing and comment 0.85 #21473 no scanf: re-work S_parse_version and push for CI 0.70 perldelta for applied patches

0.28 #20917 finally apply to blead, perldelta

4.13

2023/09/26 Tuesday 1.80 #21516 fix an issue which ended up not being what I though, polish and push for CI 1.27 #21513 review and comments 0.55 security list research

0.32 #21458 add some comments to the tests

3.94

2023/09/27 Wednesday 0.10 #21516 apply to blead 0.75 #21522 review failing tests, open downstream ticket, comment 0.90 #21523 review code, consider fixes

1.55 #21523 research, work on a fix

3.30

2023/09/28 Thursday 1.40 security issue admin, review, testing 0.35 more security issue admin 0.52 #21525 review and approve 0.10 #21526 review and approve

0.22 #21527 review and approve

2.59

2023/09/29 Friday

1.22 security issue admin: details omitted

1.22

Which I calculate is 62.14 hours.

Approximately 52 tickets were reviewed or worked on, and 10 patches were applied. ```