r/perl • u/birdsintheskies • 14h ago
r/perl • u/briandfoy • 16h ago
📅 advent calendar PerlAdvent 2026: Over a Year of The Underbar
r/perl • u/briandfoy • 1d ago
Perl Net::FTP PASV handling lets a server choose the client's next connection
r/perl • u/briandfoy • 1d ago
📅 advent calendar PerlAdvent 2026: Welcome Back
r/perl • u/Itcharlie • 2d ago
Perl Weekly Issue #801 - Call for online topics and speakers
[video] Everyday date and time handling in Perl with T - Eugen Konkov
The page with link and notes. List of perl related past and future online events.
Build a Hijri Months CLI in Perl 5 with Only Core Modules (HTTP::Tiny + JSON::PP, 24h Cache, 9 Languages)
r/perl • u/Omnideth • 3d ago
Perl - PAUSE Upload / CPAN Indexing
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 • u/niceperl • 4d ago
(dcxxviii) 18 great CPAN modules released last week
niceperl.blogspot.comr/perl • u/birdsintheskies • 5d ago
question What do you use besides perlcritic, perltidy, and perlimports to make your code consistent/nice?
r/perl • u/briandfoy • 6d ago
One Korean title, three different lengths: testing Unicode keys in Perl
blogs.perl.orgr/perl • u/briandfoy • 7d ago
Adventures in CPAN Distribution Installation: Hare We Go Again, Down the Rabbit Hole
blog.tbcdevelopmentgroup.comr/perl • u/Possible_Wait_9355 • 8d ago
Deep Learning in Perl — One Step Further (Benchmarks against PyTorch)
¿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 • u/briandfoy • 8d ago
A Module You Don’t Need — But Probably Wrote a Thousand Times
blog.tbcdevelopmentgroup.comr/perl • u/viasnake • 10d ago
Discord::Client – A Discord API client for Perl
r/perl • u/s_throwaway_r • 10d ago
Affix: FFI that makes native code feel like Perl
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/sabs(int): Affix 11.96M/s | XS 12.24M/s | Inline::C 12.19M/s | FFI::Platypus 4.96M/sstrlen(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/sabs(int): Affix 12.26M/s | XS 5.84M/s | Inline::C 5.89M/s | FFI::Platypus 2.30M/sstrlen(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.
- Repo: https://github.com/sanko/Affix.pm
- MetaCPAN: https://metacpan.org/dist/Affix
- The Affix Cookbook: https://github.com/sanko/Affix.pm/discussions/54 (WIP even though I started it almost a year ago; I'm plain terrible at coming up with useful examples)
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.
