Learning XS - Overloading

Over the past year, I’ve been self-studying XS and have now decided to share my learning journey through a series of blog posts. This fourth post introduces you to overloading operators in XS.

This week in PSC (192) | 2025-05-22

All three of us attended.

  • We discussed the situation with readline and the filehandle error flag once again, starting over by revisiting the basic premise of the error flag. We think we now have a better understanding the overall situation, and this led us to a different approach about how to correct the overall situation, which we will outline as a proposal soon.
  • We have been wanting to revert #22465 but wanted to include a testcase that demonstrates why, which we hadn’t gotten to. In order to get this into the looming final dev release, we talked through what the testcase needs to look like, and will submit a pull request ASAP.
  • We caught up on new issues and pull requests for release blocker triage. We then reviewed the state of our current release blockers, some of which have been resolved, and one of which (#23026) we demoted based on our new understanding about the readline situation.

[P5P posting of this summary]

LocalStack with AWS S3


Playing with AWS S3 using LocalStack platform.
Please check out the link below for more information.
https://theweeklychallenge.org/blog/localstack-aws-s3

Tree::DAG_Node V 1.34 uploaded to CPAN

Many thanx to Shawn Laffan for testing this version on Strawberry Perl.
I test it on my Debian machine first of course.
It took Shawn and myself a number of attempts to make all the test pass under the 2 types of OSes.

Learning XS - List context

Over the past year, I’ve been self-studying XS and have now decided to share my learning journey through a series of blog posts. This third post introduces you to list context in XS.

This week in PSC (188) | 2025-04-24

All of us showed up for a long meeting of identifying release blockers. First we went over the issues and PRs submitted since last week, none of which turned out to be new potential blockers. Then we examined all of the issues and PRs of interest we had previously identified. We applied the “Release Blocker” label where necessary, left comments, and merged a few of the PRs. Out of 20 issues and 11 PRs on our list, we identified 5 issues and 1 PR as blockers, of which the PR and several of the issues all pertain to the same problem with retention of errors on filehandles across I/O operations. This issue needs an informed decision, which we did not have the time for in this meeting, but will pursue next.

Our next meeting will be in person at the PTS.

[P5P posting of this summary]

Map::Tube Unicode


Map::Tube now supports Unicode character in station names.
Please check out the link below for more information.
https://theweeklychallenge.org/blog/map-tube-unicode

An introduction to App::ModuleBuildTiny part 2: authoring

Now that we have set up our mbtiny configuration in the previous post, we can actually use it.

Minting a new distribution

Minting a distribution is trivial once you’ve completed the setup. It’s typically just a matter of calling mbtiny mint Foo::Bar. If needed you can override the global configuration at minting time (e.g.  mbtiny mint Foo::Bar --license BSD).

Converting an existing distribution

You can also convert an existing distribution to App::ModuleBuildTiny. In most cases that requires just two things:

Learning XS - What is in my variable

Over the past year, I’ve been self-studying XS and have now decided to share my learning journey through a series of blog posts. This second post introduces the fundamentals of type checking variables in XS.

Scoping out an even conciser fork idiom

Years ago I wrote about a concise fork idiom. It turns out that it’s possible to do better than everything I discussed in that entry as well as the proposals in the comments.

I didn’t at the time appreciate a clever aspect of variable scoping in Perl:

use strict;
sub get_answer { 0 }
if ( my $answer = get_answer ) {
    ...;
} else {
    print $answer;
}

Docker Secret

A quick introduction to Docker Secret. Please check out the post for more information:
https://theweeklychallenge.org/blog/docker-secret

An introduction to App::ModuleBuildTiny part 1: setting things up

App::ModuleBuildTiny is a relatively new authoring tool. It aims to be a relatively lightweight (at least to some other tools like Dist::Zilla) and newbie friendly tool. It supports two install tools: Module::Build::Tiny (obviously what it was originally designed for) and Dist::Build; it does not support ExtUtils::MakeMaker or Module::Build.

Learning XS - How to create an object

Over the past year, I’ve been self-studying XS and have now decided to share my learning journey through a series of blog posts. This first post introduces the fundamentals of creating an perl object from XS.

This week in PSC (191) | 2025-05-15

We were all present.

  • The status of smartmatch came up. It is in a weird position where it used to be part of the language, then was retroactively declared an experiment, then deprecated and slated for removal, and now it’s no longer being removed – in fact we’ve added a feature for it, and not an experimental one either. The bottom line is that it’s not deprecated any more and not experimental either, but is now just a negative feature like indirect and multidimensional: it’s a mistake we made that will remain part of older language versions but will not be included in future feature bundles.
  • Release blocker triage continues as ever. Quite a few new issues came in recently, of which we identified two issues and one pull request as blockers. One of the issues and the PR pertain to the documentation of the status of smartmatch; we expect that there may be more inconsistencies in the documentation which will need to be ironed out.

[P5P posting of this summary]

Build Docker Image

I have detailed the process of building docker image for The Weekly Challenge website.
Please check out the post for more details:
https://theweeklychallenge.org/blog/build-docker-image

obfuscating Perl for fun and profit

(apologies for "promoting"(?) Perl obfuscation...)

Today I won a gift card at an in-office meeting with the following code. Challenge: print the numbers 1-100 in the most incomprehensible, inefficient way. My entry, edited for brevity:

#!/usr/bin/env perl
use v5.16;
splice @_, @_, -1, ++$_;
splice @_, @_, -1, ++$_;
splice @_, @_, -1, ++$_;
splice @_, @_, -1, ++$_;
splice @_, @_, -1, ++$_;
# plus 95 more of this
say join $/, @_;

Thinking about it more this evening, I came up with

$SIG {__DIE__} = sub { $_ = (pop)+0; chomp; $_%6?say:exit};
{ select undef,undef,undef,1; eval { die time-$^T }; redo; }

(where 6 instead of 101 so I don't have to wait 100 seconds (and to be honest I'm not sure if there'll be rounding errors)).

Wonder if any obfuscators could come up with better (the less inefficient, incomprehensible the better).

Faster Readonly variables with Const::XS

So, what exactly is a Readonly variable in Perl? A readonly variable is one that, once assigned a value, cannot be changed. Any attempt to modify it will trigger a runtime error. This mechanism enforces immutability, ensuring that critical values remain untouched and are protected from accidental or unauthorised alterations.

This week in PSC (190) | 2025-05-09

A meeting with full attendance.

  • We caught up with new issues and pull requests without finding any new release blockers.
  • We went over the state of the perldeprecation and perlexperiment POD pages. We found that perlexperiment does not yet reflect the change in direction regarding smartmatch. Other than that we saw nothing to do.
  • We went over our options regarding readline again at length. We concluded that we are not yet sure about the big across-the-board change to I/O functions, and are definitely too far into the release cycle to undertake a fishing expedition. But we don’t want to leave this problem entirely unaddressed during this cycle, and the change proposed by Tony Cook is a strict improvement, even if only a minimal one. So we decided to ship it, possibly with a slightly different implementation that we may suggest.

[P5P posting of this summary]

Once more unto the Wide character (U+XXXX) in substitution (s///)

I wrote very elliptically about this warning and received some helpful comments with the standard advice about how to proceed when encountering it. Except unfortunately that advice will be of no use when you encounter this warning.

Namely I should have been less cute about it and made it clear that I was specifically talking about a warning about a wide character “in substitution”. How can a s/// even possibly trigger a wide character warning, you ask? Beats me, to be entirely honest, even now, but: if you have a use locale somewhere, it turns out that it can. Because defeating that is what fixed the warning I was getting:

MCE - How to?

Have you used CPAN module MCE for parallel processing?

If not then you should checkout this post for introduction.

https://theweeklychallenge.org/blog/mce-how-to

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.