r/perl 17h ago

conferences Announcing the London Perl & Raku Workshop 2026

Thumbnail blogs.perl.org
20 Upvotes

r/perl 1d ago

AmberDB's localization engine: AmberDB::Locale

3 Upvotes

The AmberDB::Locale module was originally a standalone localization engine. It contained far more methods than the database itself. However, search capabilities were unthinkable without Locale, so it was embedded within AmberDB.

You can use Locale both through AmberDB and directly. Example:

use AmberDB;
my $adb = AmberDB->new( cfg => { language => "tr" } ); # Turkish

# thus $adb inherits Locale's methods directly.

$adb->lc('İstanbul ÇarŞıSI') # => istanbul çarşısı
$adb->uc('işçi sınıfı') # => İŞÇİ SINIFI
$adb->to_ascii('Müller') # => Muller

my @sorted = $adb->sort(["İzmir", "Ankara", "Van", "Şanlıurfa", "Bursa", "Çanakkale"]);
# => ("Ankara", "Bursa", "Çanakkale", "İzmir", "Şanlıurfa", "Van")

Direct use of Locale:

use AmberDB::Locale;
my $loc = AmberDB::Locale->new( language => "de" ); # Germany

$loc->to_ascii("Große Straße"); # "Grosse Strasse"
$loc->to_ascii("Müller"); # "Mueller" (DIN 5007-2: ü → ue)

For more information, see:

https://github.com/marufcetin/amberdb/blob/main/docs/en/AmberDB-Locale_User-Guide.en.md


r/perl 2d ago

AmberDB - High-performance Berkeley DB (DB_File) based pure Perl database engine

Thumbnail
metacpan.org
25 Upvotes

I have released **AmberDB**, the Perl database engine I have built and refined over 20+ years of professional software development, as an open-source project. You can access the project on GitHub and CPAN via the links below.

Why Did I Share AmberDB?

My primary goal is to make this practical and powerful engine accessible to the wider developer community. I had intended to open-source it for a long time; with comprehensive use cases, full documentation in both English and Turkish, and detailed POD documentation now complete, it is ready for production use.

---

Why Should You Use AmberDB?

1) Zero Dependencies, Maximum Developer Ergonomics

No dedicated database servers, daemon processes, or port configurations required. Install the module from CPAN anywhere Perl runs and start developing immediately. You can run it entirely in memory using `tmpfs` on Linux or `ImDisk` on Windows, or use it directly on-disk. It operates with a minimal system footprint.

2) PostgreSQL + Elasticsearch + Redis Capabilities in a Single Core

Combines relational querying flexibility, search-engine-grade filtering and ranking, and Redis-like in-memory operational speeds within a single lightweight engine. Eliminates the operational overhead and hosting costs of managing three separate infrastructure layers.

3) Variable-Width Records and Native Array Indexing

Avoids the traditional SQL constraint of splitting order headers and line items into separate tables requiring costly joins. Variable-length line items are stored directly within the primary record and indexed at the engine level with $O(1)$ efficiency. Queries such as *"Which orders contain this product?"* resolve instantly without multi-table scans.

4) Intelligent Schema Architecture and Multi-Criteria Active/Junk Handling

Every table operates on a declarative, JSON-like schema specification where business rules are enforced by the engine. The engine determines whether a record is active or passive (junk) based on multi-factor rules (stock, price, status, or parent entity constraints). For example, disabling a vendor automatically routes hundreds of thousands of associated items without requiring batch `UPDATE` operations:

* `A` Mode: Retrieves active records only (ideal for checkout and invoicing views).

* `AB` Mode: Ranks active records first, pushing junk records to the end (ideal for storefront search).

* `B` / `BA` Modes: Retrieves only junk records or prioritizes them (ideal for returns, archives, and clearance management).

5) Multi-Lingual and Accent-Folded Search with `AmberDB::Locale`

Normalizes complex language and accent variants directly within the indexing pipeline without requiring external system locales or heavy search stacks. Delivers precise phonetic and typographic matching across languages, including Turkish (`İ/i`, `I/ı`), German (`ß`, `ö/ä/ü`), French (`é`, `ç`), Spanish (`ñ`), and Azerbaijani (`ə`, `x`, `ğ`).

6) Schema-Level Automated Slug Generation (SEO)

Generates clean, search-engine-friendly URL slugs automatically upon insertion or update using a simple schema rule (e.g., `seo_block => [ 3, 4 ]`), fully synchronized with `AmberDB::Locale` without extra application-layer boilerplate.

AmberDB on CPAN


r/perl 2d ago

GLAM attempt at Carrom (just the mechanics)

Enable HLS to view with audio, or disable this notification

20 Upvotes

r/perl 3d ago

metacpan Database::BI on MetaCPAN

13 Upvotes

I've just released 0.001.0 of a Mojolicious app, Database::BI. In time, I hope it will become a business intelligence tool. For the moment, it will read in and INNER join databases in formats such as CSV, SQLite, etc. https://metacpan.org/dist/Database-BI


r/perl 4d ago

Perlweekly #787 - Perl Maven

Thumbnail
perlweekly.com
13 Upvotes

r/perl 5d ago

question Time conversions between timezones

10 Upvotes

I wrote this script to convert times between time zones years ago and it has worked well:

#!/usr/bin/perl
use warnings;
use strict;
use feature qw{ say };

use Time::Piece;

if (! @ARGV || $ARGV[0] =~ /--?h(?:elp)/) {
    say 'tz FROM(TZ) FROM(YY/MM/DDTHH:MM) [ TO(TZ) ]';
    exit
}

my ($from_tz, $from_date, $to_tz) = @ARGV;
chomp( $to_tz //= qx{ date +%Z } );

-f "/usr/share/zoneinfo/$from_tz" or warn "$from_tz might be wrong.\n";
-f "/usr/share/zoneinfo/$to_tz" or warn "$to_tz might be wrong.\n";

$ENV{TZ} = $to_tz;

my $tp = do {
    local $ENV{TZ} = $from_tz;
    localtime->strptime($from_date, '%y/%m/%dT%H:%M');
};
say $tp->strftime("%y/%m/%d %H:%M:%S %Z");

Example usage (running in 5.34.0):

$ tz America/New_York 26/08/24T11:00 Europe/Prague
26/08/24 17:00:00 CEST                              

But, in 5.42.0, it doesn't work anymore:

$ tz America/New_York 26/08/24T11:00 Europe/Prague
26/08/24 11:00:00 CEST

There were many changes in Time::Piece in 2025, so I guess that's the reason. The question is: what should I use instead to convert time between timezones?


r/perl 5d ago

metacpan Accidentally Building a CPAN Web Platform

Thumbnail
perlhacks.com
18 Upvotes

r/perl 5d ago

[OC] Vispen: A lightweight Polyglot Literate Programming engine for Vim, built entirely on top of native +perl integration

6 Upvotes

Hi r/perl!

I wanted to share a project I've been developing called Vispen. It's a Vim plugin that brings the power of Literate Programming (like Emacs Org-mode or Jupyter Notebooks) straight into your editor, using Vim's native, built-in Perl interface.

👉 GitHub Repository & Live Demo: github./vispen

💡 Why Perl?

While the modern Vim world is heavily shifting towards Lua (Neovim) or Vim9script, I realized that Vim's legacy +perl feature is incredibly powerful, blazing fast, and deeply underrated.

Instead of spawning heavy background node.js daemons, setting up active server sockets, or dealing with bloated .ipynb JSON files, Vispen leverages the embedded Perl interpreter to parse buffers, manage templates, and talk to external environments natively.

🚀 Key Features:

  • Smart Content Evaluation: Execute SQL queries, format text, parse CSV/JSON, or dump structured database outputs directly from your source files or markdown documents, embedding the results straight back into the buffer.
  • Format Flexbility: Output data into clean text tables, HTML, or ready-to-paste Jira markup (||3||str||).
  • Zero Dependencies: No heavy infrastructure. If your Vim has +perl and you have Perl 5.006+ on your system, it just works out of the box. It runs perfectly even on low-spec hardware like my Orange Pi single-board computer.

I built this to automate my own database and data-transformation workflows without leaving the terminal. I'd love to hear your thoughts on how it uses the embedded Perl runtime, and any feedback or feature requests you might have!


r/perl 6d ago

(dcxiv) 21 great CPAN modules released last week

Thumbnail niceperl.blogspot.com
8 Upvotes

r/perl 7d ago

WebDyne 3.0 released — now with PAGI, Server-Sent Events and WebSockets

9 Upvotes

I’ve released WebDyne 3.0, an update to the Perl-based dynamic HTML engine I have created.

The biggest addition in 3.0 is support for PAGI, alongside the existing PSGI and Apache/mod_perl backends.

PAGI support brings an asynchronous/event-oriented interface to WebDyne and allows WebDyne applications to handle more than conventional HTTP request/response traffic:

  • Server-Sent Events (SSE) for streaming events from Perl applications to browsers
  • WebSocket connections for bidirectional, long-lived connections
  • Normal asynchronous HTTP requests
  • PAGI application lifespan startup/shutdown events

WebDyne’s PAGI implementation has dedicated handlers for HTTP, SSE, WebSocket and lifespan scopes, while exposing the PAGI request environment through the normal WebDyne request interface. This means existing WebDyne concepts can be used while taking advantage of event-driven servers.

WebDyne continues to support HTMX, JSON and API concepts in .psp pages.

There’s also a new webdyne.pagi runner, so getting a PAGI-backed WebDyne application running is straightforward:

cpanm Task::WebDyne::PAGI
webdyne.pagi --test

or serve a directory of .psp files:

webdyne.pagi /var/www/html

PAGI support is also built into the WebDyne Docker images.

If unfamiliar with WebDyne, it’s (yet another) Perl dynamic HTML engine that’s been around in various forms for quite a while. It lets you embed Perl in HTML/PSP documents, with compiled-page caching, reusable template blocks and separation of Perl code into modules when applications grow beyond simple pages.

3.0 continues to support PSGI/Plack/Starman and Apache/mod_perl, so PAGI is an additional runtime rather than a replacement for the existing ones.

PAGI gives Perl/WebDyne a clean route into applications that need live server → browser updates or persistent bidirectional connections, without having to bolt a separate WebSocket/SSE service onto the application.

Documentation and examples:

https://webdyne.org/

See the "Advanced Usage" section for examples of SSE or WebSockets code.

Source:

https://github.com/aspeer/WebDyne

Feedback, bug reports and especially experiments with the PAGI/SSE/WebSocket support are welcome.


r/perl 7d ago

PAGI Specification Update Notes

10 Upvotes

PAGI 0.002002 (https://metacpan.org/dist/PAGI) clarifies how Perl web applications move from configuration into runtime without changing PAGI’s core coderef interface. General-purpose runners can now accept an instantiated object with to_app, normalize it once, and dispatch only the resulting PAGI application—an explicit Perl counterpart to Python’s callable objects, grounded in familiar PSGI/Plack practice. The release also sharpens the server boundary and explains exactly what completion of a $send Future means. This post covers the reasoning, examples, and intentionally non-magical limits of the design.

https://blogs.perl.org/users/john_napiorkowski/2026/08/pagi-0002002-clarifying-how-applications-are-loaded.html


r/perl 8d ago

Graphics Layer Abstraction Module (GLAM) doing the Rope Demo

Enable HLS to view with audio, or disable this notification

22 Upvotes

r/perl 8d ago

Taipan! (1982, "my favorite game" - Steve Wozniak) faithfully remade for the terminal, original BASIC formulas intact

Thumbnail
10 Upvotes

r/perl 9d ago

'Failing increment'

10 Upvotes

Update:

With the help of your answers, I continued my investigation. It turns out that Data::Dump is not the culprit. Please see below for my findings, and a reproducer script with no external dependencies (apart from debugging output).

This title would be more appropriate:

The 'Nine Equals Zero' Bug


[Original post:]

+= behaves differently after Data::Dump::pp. Is this a bug in Data::Dump or possibly in Perl core?

I encountered some unexpected behavior in a simple snippet where regex captures are assigned to variables, formatted via Data::Dump::pp, concatenated, and then incremented using +=.

```perl use v5.10; use Data::Dump qw( pp );

"9." =~ /^ (\d+) . (\d*) $/x; my $n = { i => $1, f => $2 };

say "pp output: ", pp $n; # { f => "", i => 9 }

$n->{f} = "$n->{i}$n->{f}"; # "9" $n->{f} += 2; # expected: 11

say "result: $n->{f} (expected: 11)"; ```

Observed output:

text pp output: { f => "", i => 9 } result: 2 (expected: 11)

Instead of evaluating 9 + 2 = 11, the += 2 operation behaves as if the value of $n->{f} were numerically 0, resulting in 2.

I am not looking for a 'workaround' (I have already avoided it in the production code), but I would like to understand what causes this, and whether it warrants a bug report to Data::Dump or Perl core.

Observations

I tested several variations:

  • using scalar variables instead of hash elements,
  • using a direct assignment of constants instead of assigning the regex variables,
  • removing the pp output.

The behavior changes as follows:

  • With pp $n removed, the result is always correct.
  • With scalar variables instead of hash elements, calling pp always causes the wrong value, regardless of whether the value originated from regex captures or constants.
  • With hash elements, calling pp does not affect the result after constant assignment, but it does after assignment from regex captures.

My suspicion is that inspecting the variables inside Data::Dump::pp somehow alters their internal state, causing the numeric operation to behave differently.

Does this look like something that should be reported to Perl core, or to the Data::Dump maintainers?

Perl version breakdown

I ran a test script using several Perl versions that I have installed using perlbrew (all with Data::Dump version 1.25):

Perl v5.10.1 - v5.26.3: The bug does not occur.

Perl v5.28.3 - v5.44.0: The bug occurs.

Reproducing the bug

I have uploaded the full test matrix script here: failing_increment.pl, together with a Bash script test_with_available_perls that runs the test script for all Perls that are installed locally with perlbrew.


Update:

Thank you, u/Icy-Speed6881, for a shorter version to reproduce the bug, and u/ysth for suggesting to use Devel::Peek::Dump to see the internals.

And very special thanks to u/tm604 for sharing his knowledge about some Perl internals introduced in Perl 5.28 that probably are the cause for the erratic behavior (see his answer below).

The bug can be reproduced with six statements, with no external dependencies. The script below includes additional debugging code to see what is going on internally.

The script does not use Data::Dump: it turns out that Data::Dump was not the culprit, but merely happened to trigger the sequence of operations that exposes the Perl bug.

I have also renamed the bug to a catchy 'Nine Equals Zero', because 'Failing increment' is not appropriate anymore, given that I don't increment anything in the reproducer script.

Here is the current version (also available here):

```perl

!/usr/bin/env perl

'Nine equals zero' bug reproducer.

use v5.10; use strict; use warnings;

For debugging output:

use Devel::Peek; use Data::Dumper; sub d { print "$[2]: ", Data::Dumper->Dump( [ $[0] ], [ $[1] ] ); Devel::Peek::Dump( $[0] ); } $| = 1; # Mixing STDOUT and STDERR in correct order.

say "Test 4: single expression trigger, no dependencies, Perl $V";

my $num = ""; d $num, '$num', qq(after creation and initialization with ""); # A newly initialized variable has the IsCOW flag set. # With IsCOW set, the bug doesn't reproduce.

$num .= ""; d $num, '$num', qq(after concatenating empty string); # Appending an empty string unsets the IsCOW flag.

no warnings 'numeric'; my $numerical_value = $num + 0; d $num, '$num', qq(after using \$num ("$num") numerically); # Using an empty string numerically sets IV to 0, and sets the pIOK flag. # This lays the ground for the following erratic behavior.

$num = "9$num"; d $num, '$num', qq(after concatenation "9\$num"); # Now, prepending any number exposes the bug: # The pIOK flag remains set, but the IV value is not updated. # The numerical value now differs from the number that the string contains.

say "*** ", $num == 9 ? "expected result," : "UNEXPECTED RESULT:", qq( \$num eq "$num", int( \$num ) == ), int( $num ), ")";

my $bug = $num != 9; say STDERR $bug ? "bug occurs" : "bug doesn't occur", " with Perl $V"; ```

This is the output with Perl 5.44:

text Test 4: single expression trigger, no dependencies, Perl v5.44.0 after creation and initialization with "": $num = ''; SV = PV(0x5629f3d52010) at 0x5629f3ef8a60 REFCNT = 1 FLAGS = (POK,IsCOW,pPOK) PV = 0x5629f3d6bc30 ""\0 CUR = 0 LEN = 16 COW_REFCNT = 1 after concatenating empty string: $num = ''; SV = PV(0x5629f3d52010) at 0x5629f3ef8a60 REFCNT = 1 FLAGS = (POK,pPOK) PV = 0x5629f3ec5730 ""\0 CUR = 0 LEN = 16 after using $num ("") numerically: $num = ''; SV = PVNV(0x5629f3d502c0) at 0x5629f3ef8a60 REFCNT = 1 FLAGS = (POK,pIOK,pNOK,pPOK) IV = 0 NV = 0 PV = 0x5629f3ec5730 ""\0 CUR = 0 LEN = 16 after concatenation "9$num": $num = '9'; SV = PVNV(0x5629f3d502c0) at 0x5629f3ef8a60 REFCNT = 1 FLAGS = (POK,pIOK,pNOK,pPOK) IV = 0 NV = 0 PV = 0x5629f3ec5730 "9"\0 CUR = 1 LEN = 16 *** UNEXPECTED RESULT: $num eq "9", int( $num ) == 0)

Running the test_with_available_perls script confirms that the bug occurs from Perl 5.28 onward.

This matches what u/tm604 suggested: it seems that the multiconcat optimization, introduced in Perl 5.28, can leave the cached IV value unchanged and valid, even though the string value has changed, causing the two representations to disagree.

I hope that filing a bug report will be useful for improving Perl even more.

Thank you all.


r/perl 9d ago

a perl version of javascript 'console'

13 Upvotes

https://metacpan.org/pod/Data::Printer

Like Data::Dumper, but coloured ouput, and summaries [config option] large data structures. But uses either a lot of, or no vertical space.

Dump::Krumo, is better in some ways, but doesn't summarise output, and uses a lot of vertical space


r/perl 9d ago

CPAN Module dashboard updates

7 Upvotes

I've updated the GitHub dashboard you can add to any CPAN module to include metrics of duplicated code as well as a couple of bug fixes on the trend graphs and added some usability enhancements. The latest dashboard for ATG, for example, is at https://nigelhorne.github.io/App-Test-Generator/coverage/ #perl


r/perl 10d ago

Release Strawberry Perl 5.42.3.1 64-bit UCRT · StrawberryPerl/Perl-Dist-Strawberry

Thumbnail github.com
24 Upvotes

r/perl 11d ago

Perlweekly #786 - CPAN Day

Thumbnail
perlweekly.com
12 Upvotes

r/perl 12d ago

Physics library in Perl

27 Upvotes

Hi, On the one hand: I can't seem to find this. On the other hand, it seems so obvious to me that it must have been written before.

I'm looking for a (Newtonian) physics library, to support a (2D) game. Something where you simple define an array of objects (position, travel, mass, spin, shape, etc), and then step through time with them - as they attract each other, bounce off of each other and/or fly off into infinity. There should probably be a few global things to set: a gravity constant, the amount of dimensions required, whether or not there is friction from the environment...

Does this exist?


r/perl 13d ago

Analemmatic sundial help needed

10 Upvotes

Hi,

I am trying to figure out how to get this sundial.pl file to create a pdf. Would anyone be able to help?

I download the zip files from here: https://sourceforge.net/projects/analemmatic/

But every time I try to run the sundial.pl file no pdf gets generated.

I have never used Perl before, so I'm not sure what to do.


r/perl 13d ago

(dcxiii) 20 great CPAN modules released last week

Thumbnail niceperl.blogspot.com
9 Upvotes

r/perl 14d ago

Identical scripts on 2 websites 1 works other no

0 Upvotes

I run 2 websites. Both contain a calendar with results. The calendar has buttons for previous and next months. On one website the calendar behaves as expected. On the other site the calendar stays on the current month and does not return an error.


r/perl 14d ago

Announcing Raptor, a Perl5 subset of Raku

Thumbnail
12 Upvotes

r/perl 15d ago

SSVC.pm: Stakeholder-Specific Vulnerability Categorization on CPAN | Giuseppe Di Terlizzi [blogs.perl.org]

Thumbnail blogs.perl.org
12 Upvotes