DEV Community

Gabor Szabo
Gabor Szabo

Posted on • Originally published at perlweekly.com

Perl 🐪 Weekly #724 - Perl and XS

Originally published at Perl Weekly 724

Hi there,

What's XS?

XS (eXternal Subroutine) is a glue language that helps Perl interact with C.

Sounds simple?

In my personal experience, it's not simple at all. I've tried many times but never managed to fully grasp it. Recently, Robert Acock, shared a blog post series titled Learning XS, which I found very helpful in unraveling its complexity.

Robert Acock also wrote another blog series for newcomers: Learning Perl. I'm sure this would be handy for anyone looking to explore Perl.

Lately, I've been playing with AWS S3 and have shared my experiences in two posts so far:

There are plenty more articles in the pipeline, so watch this space!

Enjoy the rest of the newsletter.

--
Your editor: Mohammad Sajid Anwar.

Announcements

DBD::Oracle v1.91_2 released

With help from the community a development release of DBD::Oracle has been published to the CPAN.

Formally announcing Perl Magpie

Perl Magpie serves as a user frontend for the CPT database backend. It operates 100% using the CPT API to fetch test metadata and results.


Articles

Generating Content with ChatGPT

Yet another quality post that shows the power of ChatGPT.

Learning XS

A blog series to learn XS ground up.

Learning Perl

A blog series to learn Perl.

Analysing FIT data with Perl: basic beginnings

FIT files record the activities of people using devices such as sports watches and bike head units.

AWS S3 Encryption

This is first post in the series about AWS S3 Encryption in general.


Discussion

Are you still using the 2-argument open?

It's well documented suggestion to always use 3-argument open function. This post shares the reason.


The Weekly Challenge

The Weekly Challenge by Mohammad Sajid Anwar will help you step out of your comfort-zone. You can even win prize money of $50 by participating in the weekly challenge. We pick one champion at the end of the month from among all of the contributors during the month, thanks to the sponsor Lance Wicks.

The Weekly Challenge - 325

Welcome to a new week with a couple of fun tasks "Consecutive One" and "Final Price". If you are new to the weekly challenge then why not join us and have fun every week. For more information, please read the FAQ.

RECAP - The Weekly Challenge - 324

Enjoy a quick recap of last week's contributions by Team PWC dealing with the "2D Array" and "Total XOR" tasks in Perl and Raku. You will find plenty of solutions to keep you busy.

Two Dimensional XOR Not?

It procides efficient solutions to both tasks, with clear explanations and examples. The implementations leverage Perl's strengths (e.g., built-in hashes for set operations, Math::BigInt for arbitrary-precision arithmetic).

TWS324

Great show of CPAN modules power. It allows us to create a compact and efficient solutions. Well done.

Exclusive or 2D

The solution leverages Raku’s expressive syntax in a way that is both concise and readable. Slicing with [..*] captures the "L-shaped" region without verbose loops. The use of +^= for accumulation is both efficient and visually distinctive.

Perl Weekly Challenge: Week 324

The XOR subset sum write-up doesn’t just present code—it reflects on how subsets behave and how XOR values aggregate, which is the hardest part of the task. Use of naive exponential approach before opting for clarity over cleverness.

Or Is It Reshaped?

This is for all PDL fans. I enjoy thoroughly every time, I read PDL solutions. Keep sharing knowledge with us.

Perl Weekly Challenge 324

The solutions are notable for their clarity, efficiency, and effective use of Perl's capabilities. By employing modules like PDL and List::Util, he addresses complex problems with succinct and performant code.

Reduce and Reduce, and Reduce!

It uses frequency counting with a hash to avoid O(n²) complexity. Inline explanation clarify non-trivial steps.

Totally 2bular!

It's a well-crafted and informative piece that balances technical rigor with creative flair, making it a valuable read for both novice and experienced programmers interested in the nuances of multi-language coding challenges.

Fun with arrays

The post stands out for its clarity, depth, and instructional value. His explanations are accessible, making complex concepts understandable for a broad audience. The code is well-structured and annotated, providing readers with valuable insights into Perl programming and problem-solving techniques.

The Weekly Challenge #324

The post is commendable for its clarity, thoroughness, and innovative problem-solving techniques. His ability to identify ambiguities in problem statements and address them proactively enhances the reliability of his solutions. The post serves as an excellent resource for Perl enthusiasts and programmers seeking to deepen their understanding of array manipulation and bitwise operations.

The Total Array of Xor in 2-D

No overengineering solutions match the challenge’s scale. Comparing Rust/Raku implementations teaches language-agnostic problem-solving.

The total array

It starts with a concise Python version, then thoughtfully converts it to Perl. Great for readers fluent in one language who wish to learn the other.

The Weekly Challenge 324

The solutions exemplify idiomatic Perl programming, showcasing the language's strengths in concise and expressive code. The post is informative and demonstrates a deep understanding of Perl's capabilities, making it a valuable resource for programmers seeking elegant solutions to common challenges.


Rakudo

2025.22 SurveyOverflow


Weekly collections

NICEPERL's lists

Great CPAN modules released last week;
MetaCPAN weekly report.


Events

Paris.pm monthly meeting

Paris, France

The Perl and Raku Conference 2025

Greenville, South Carolina, USA


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.

Top comments (0)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.