r/perl • • 1d ago

📅 advent calendar 2026 Perl Advent Megathread

15 Upvotes

r/perl • • 14h ago

question Is perl more complicated to parse than other languages, or is that exaggerated?

24 Upvotes

Tools like semgrep, ast-grep, CodeQL, etc. do not support Perl, and I'm wondering if there is something particularly difficult about parsing Perl compared to other languages.


r/perl • • 16h ago

📅 advent calendar PerlAdvent 2026: Over a Year of The Underbar

Thumbnail
perladvent.org
9 Upvotes

r/perl • • 1d ago

Perl Net::FTP PASV handling lets a server choose the client's next connection

Thumbnail
dev.to
7 Upvotes

r/perl • • 1d ago

📅 advent calendar PerlAdvent 2026: Welcome Back

Thumbnail
perladvent.org
41 Upvotes

r/perl • • 2d ago

Perl Weekly Issue #801 - Call for online topics and speakers

Thumbnail
perlweekly.com
7 Upvotes

r/perl • • 2d ago

[video] Everyday date and time handling in Perl with T - Eugen Konkov

Thumbnail
youtube.com
5 Upvotes

The page with link and notes. List of perl related past and future online events.


r/perl • • 2d ago

Build a Hijri Months CLI in Perl 5 with Only Core Modules (HTTP::Tiny + JSON::PP, 24h Cache, 9 Languages)

Thumbnail
dev.to
8 Upvotes

r/perl • • 2d ago

Faster edit distance - Text::EditDistance::DamerauLevenshtein

Thumbnail blogs.perl.org
21 Upvotes

r/perl • • 3d ago

Perl - PAUSE Upload / CPAN Indexing

12 Upvotes

Looking for some guidance here because I recently submitted something to PAUSE for the first time and am not clear what the next steps are. Would anyone be willing to discuss what's next with me?

I got email responses that the file was uploaded and CPAN Testers would report results (it said within an hour, but it was close ish to the Thanksgiving holiday in the US, so I figured it would not be that quick.)

It's very possible I missed some steps.


r/perl • • 4d ago

(dcxxviii) 18 great CPAN modules released last week

Thumbnail niceperl.blogspot.com
7 Upvotes

r/perl • • 5d ago

Shipping Agent Stuff

Thumbnail
olafalders.com
6 Upvotes

r/perl • • 5d ago

question What do you use besides perlcritic, perltidy, and perlimports to make your code consistent/nice?

16 Upvotes

r/perl • • 6d ago

One Korean title, three different lengths: testing Unicode keys in Perl

Thumbnail blogs.perl.org
15 Upvotes

r/perl • • 7d ago

Adventures in CPAN Distribution Installation: Hare We Go Again, Down the Rabbit Hole

Thumbnail blog.tbcdevelopmentgroup.com
13 Upvotes

r/perl • • 8d ago

Deep Learning in Perl — One Step Further (Benchmarks against PyTorch)

17 Upvotes

¿Te acuerdas de mi artículo en Medium?
https://medium.com/@marcontk/perl-in-jupyter-notebook-a-modern-look-for-a-classic-language-db2f3c0fd5e6

One Step Further: Deep Learning in Perl ...

Sí, aprendizaje profundo en Perl en la GPU.

Un marco de aprendizaje profundo para Perl, con una arquitectura de backend intercambiable. Aquí están sus primeras comparativas de rendimiento frente a PyTorch.

Prueba métrica mi código Pytorch mi código/Pytorch
matmul 64 x [32x32]      ms               0.018        0.025       0.73

matmul 16 x [128x128]    ms                0.066        0.036       1.82

matmul [512x512]         ms                0.156        0.121       1.28

matmul [1024x1024]       ms                 1.39         1.21       1.15

ResNet-18 inferencia     ms                 3.76         3.83       0.98

MLP sin(x)               ms/paso           0.341        0.487       0.70

MLP sin(x)               MSE            2.54e-03     6.29e-03           

CNN MNIST                s/época            3.77         3.10       1.22

CNN MNIST                exactitud         0.989        0.988           

Autoencoder              s/época            1.56         1.34       1.16

Autoencoder              PSNR dB           20.45        20.30           

Transformer TATA         ms/paso            4.78         3.84       1.24

Transformer TATA         exactitud         0.760        0.708           

Conv1D TATA              ms/paso           0.972         1.06       0.92

Conv1D TATA              exactitud          1.00         1.00       

Próximamente habrá más detalles y la historia detrás del proyecto en Medium.

   


r/perl • • 8d ago

A Module You Don’t Need — But Probably Wrote a Thousand Times

Thumbnail blog.tbcdevelopmentgroup.com
18 Upvotes

r/perl • • 9d ago

Perl Weekly Issue #800 - Perl v5.45.5

Thumbnail
perlweekly.com
13 Upvotes

r/perl • • 9d ago

[video] Punk: Perl MVC compiled at boot with Robert Acock (LNATION)

Thumbnail
youtube.com
10 Upvotes

r/perl • • 10d ago

The Underbar, episode 12: Vienna.pm

Thumbnail
underbar.cpan.io
6 Upvotes

r/perl • • 10d ago

Discord::Client – A Discord API client for Perl

Thumbnail
github.com
5 Upvotes

r/perl • • 10d ago

Data Munging with Perl: Twenty-Five Years Later

Thumbnail
perlhacks.com
56 Upvotes

r/perl • • 10d ago

Affix: FFI that makes native code feel like Perl

29 Upvotes

Affix is an FFI for Perl with a simple set of goals:

  • calling native code and dealing with raw memory should feel like writing ordinary Perl
  • it should be incredibly fast
  • the name should describe the act of binding something to something else and have 'FFI' in the dead center so you don't forget what it is

I wanted an FFI that feels good. This is what I came up with:

use v5.40;
use Affix qw[:all];
affix libc(), 'strlen', [ String ] => Size_t; # This is a terrible example but...
say strlen('hello');    # ...five.

Or maybe you're on Windows?

use Affix qw[:all];
wrap( 'user32', 'MessageBoxA', [ UInt, String, String, UInt ] => Int )->( 0, 'JAPH,', 'Hello, World', 0 );

...okay, hardly groundbreaking so far but I'm starting slow.

Affix is a bundle of amazing stuff but the type system might be the secret sauce. Primitives, enums, unions, bitfields, structs (including packed and nested structs), pointers, callbacks, variadics, wide strings, file handles, 128bit numerics, C99 complex numbers, flexible and n-dimensional arrays, and SIMD vectors are all first-class. Cast C memory and you get native Perl hashes and arrays with magic underneath, so $p->{x} = 42; writes straight into the C struct. You can even pin a scalar to an exported symbol or address in memory and read and write through it. No generated accessor methods, no copies, no ceremony.

use v5.40;
use Affix qw[:memory :types :core];
use Affix::Build;
#
my $c = Affix::Build->new;
$c->add( \<<~'C', lang => 'c' );
    typedef struct { int x; int y; } Point;
    int get_x( Point * pt ) { return pt->x; }
    int get_y( Point * pt ) { return pt->y; }
    Point new_pt( int x, int y ) { Point pt = { .x = x, .y = y }; return pt; }
    C
#
typedef Point => Struct [ x => Int, y => Int ];
affix $c->link, 'get_x', [ Pointer [ Point() ] ] => Int;
affix $c->link, 'get_y',  [ Pointer [ Point() ] ] => Int;
affix $c->link, 'new_pt', [ Int , Int ] => Point();
#
my $p = cast( malloc( sizeof Point() ), Point() );    # Allocates memory and pins a scalar to it
$p->{x} = 42;                                         # Writes directly to memory
$p->{y} = 7;
#
say get_x($p) . ' x ' . get_y($p);                    # The pin works as a pointer arg (42 x 7)
say get_x( { y => 50, x => 100 } );                   # Hashes are coerced automatically (100)
#
free $p;                                              # Auto-freed at end of scope, or freed early manually
$p->{x} = 1000;                                       # No longer bound to C memory; just a normal hashref now
#
my $p2 = new_pt(30, 25);
say $p2->{x} . ' x ' . $p2->{y};                      # struct from C is treated as a hashref (30 x 25)
say get_x($p2);                                       # Which you can turn around and hand back to native code even as a pointer (30)

In that example, I used Affix::Build which wraps compilers and build systems from Assembly to Zig to create shared libs for Affix (or even FFI::Platypus!). Think of it as Inline::C for FFI.

use v5.40;
use Affix qw[affix Int];
use Affix::Build;
#
my $c = Affix::Build->new;
$c->add( \<<~'C', lang => 'c' );
    int plus(int a, int b) { return a + b; }
    C
#
affix $c->link, 'plus', [ Int, Int ] => Int;
say plus( 2, 3 ); # ...also five.

You can even compile and link multiple languages into a single lib as long as they share similar ABIs. I'm not sure why you'd want to do that but you can.

Affix::Wrap goes the other direction: hand it C/C++ headers and it parses them using Clang's AST (with a pure-Perl fallback if you don't have LLVM installed) to generate bindings for an entire library. Bindings are ready to run immediately, or you can export them as an early draft if your project is bound for CPAN.

So, we've made native code feel like Perl but is it fast?

FFI can come with a lot of overhead but I regularly benchmark Affix against hand-written XS, Inline::C, and FFI::Platypus. Here's a quick snapshot from the latest v1.4.3 dist:

Linux x86_64 (perl v5.42.0)

  • sin(double): Affix 14.45M/s | XS 14.15M/s | Inline::C 13.31M/s | FFI::Platypus 5.32M/s
  • abs(int): Affix 11.96M/s | XS 12.24M/s | Inline::C 12.19M/s | FFI::Platypus 4.96M/s
  • strlen(const char*): Affix 11.60M/s | XS 15.35M/s | Inline::C 16.59M/s | FFI::Platypus 5.39M/s

Windows x64 (perl v5.42.3)

  • sin(double): Affix 16.60M/s | XS 5.36M/s | Inline::C 5.39M/s | FFI::Platypus 2.42M/s
  • abs(int): Affix 12.26M/s | XS 5.84M/s | Inline::C 5.89M/s | FFI::Platypus 2.30M/s
  • strlen(const char*): Affix 11.03M/s | XS 6.59M/s | Inline::C 6.59M/s | FFI::Platypus 2.41M/s

(Full multi-platform results including aarch64 and macOS are in this workflow run.)

XS can still win on very well-optimized calls, and Inline::C and FFI::Platypus are battle-tested tools that I have a lot of respect for. The point of Affix is that you don't have to trade away runtime binding, rich types, or zero-copy structs to get near-XS (or better) call throughput.

I'll try to write more about the things I'm working on. I rarely see my own projects as complete or even far enough along for a public announcement like this. To demonstrate just how silly that is, Affix has been on CPAN for five years but I've never spoken or even written about it at length outside of the project's repo. I think the projects I pick up are all cool, and it'd be nice if others thought so too, which is hard to do if no one knows they exist. My current goal for Affix is to support popular compilers on every 64bit system I can buy or find a GitHub runner for: Windows, Linux, macOS, Haiku, Solaris, Android (Termux), GNU/Hurd, and several BSDs on x64, ARM, and RISC-V so far. Part of feeling like Perl is working (when it makes sense) where Perl works.


r/perl • • 11d ago

#PeakPerl

Thumbnail
reddit.com
5 Upvotes