Recent Perl modules, releases and favorites.
Last updated 13 August 2026 04:30 PM
Last updated 13 August 2026 04:30 PM
Device-Chip-BME280
Release | 13 Aug 2026 02:04 PM | Author: PEVANS | Version: 0.08
Chip driver for BME280
Device::Chip::BME280 is a Perl driver for the Bosch BME280 environmental sensor that talks to a host over I2C. It builds on the BMP280 driver to add humidity support while inheriting temperature and pressure features, and it is designed for asynchronous use returning Future objects for operations such as mounting an adapter, reading converted sensor values with read_sensor (pressure in Pascals, temperature in degrees Celsius, humidity in percent) and reading raw ADC values for testing with read_raw. You can read or change chip configuration including humidity oversampling via OSRS_H and mount with a non-default I2C address if needed. Recent updates also add automatic handling of BMP280 variants and detection of failed sensors that report all-zero ADC readings.
Text-Hogan
Release | 13 Aug 2026 12:04 PM | Author: EDF | Version: 2.06
Upvotes: 1 | CPAN Testers: Pass 100.0%
Text::Hogan - A mustache templating engine statement-for-statement cloned from hogan.js
Text::Hogan is a Perl port of Twitter's hogan.js that brings Mustache templating to Perl by compiling templates into pure Perl code for very fast rendering. It implements the full Mustache specification, including lambda sections, and aims to behave statement-for-statement like hogan.js so templates are portable between the JavaScript and Perl ecosystems. The module is useful when you need simple logic-less templates, want to precompile templates for repeated high-performance rendering, or require compatibility with existing hogan templates. Recent releases focus on modernizing dependencies and improving compile and runtime speed, so it is a mature, actively maintained choice for Mustache templating in Perl.
Scalar-ValueTags
Release | 13 Aug 2026 10:24 AM | Author: ZHTWN | Version: 0.006
Attach propagated metadata to data values
Scalar::ValueTags lets you attach metadata to Perl scalar values so that provenance or other annotations travel with the value whenever it is assigned or combined with other values. You register a value-tags type that defines how tags are stored and merged and then use simple functions to add, remove, query, or clear tags; available behaviors include unique string sets, counted hashes, append-only arrays, and de-duplicated reference arrays so you can choose the merging and storage model that fits your needs. It is useful for tracking data flow, auditing, or applying source-based access logic without changing the underlying data structures. The implementation relies on Perl core value-magic (Magic v2) so you should check value_tags_enabled to confirm support on your Perl build. The author notes that the module currently does not throw automatically if value tags are unavailable and that debugging support is not yet implemented.
Dist-Starter
Release | 13 Aug 2026 10:05 AM | Author: SVW | Version: v0.2.0
A command-line utility for rendering Perl project templates
Dist::Starter is a lightweight command-line utility for bootstrapping Perl distribution skeletons from reusable templates, providing a diststarter script that accepts a distribution or module name and fills a template with sensible defaults for abstract, author, license, minimum Perl version, initial version and more. It can derive author info from the system GECOS, git config or environment variables, supports custom template and output directories, and offers a dry-run mode that prints the generated context as YAML so you can inspect values before writing files. Defaults are configurable via an XDG-style run-control file and templates can include additional "share" placeholders for richer scaffolding. The module is currently alpha and still documents a few TODOs, and the recent 0.2.0 release added license and initial-version options, improved author info handling, introduced share placeholders and now normalizes a provided module name to a distribution name.
Southern crucis constellation for your applications
Acrux is a compact Perl utility collection that supplies building blocks for application development, offering logging, file locking, a Damm checkdigit/digest implementation and small helpers for parsing and formatting so you do not have to reinvent common chores. It is presented as a companion to Acme::Crux and aims to be a lightweight, practical toolkit for developers who need simple, well scoped services such as configurable logging backends, lock file management and utility routines. Recent updates added a richer file lock metadata (including owner UID) and an optional system-level flock mode, and the logging defaults were changed to STDERR with explicit options to target stdout, stderr or syslog if needed. The project is actively maintained and distributed under the Artistic License 2.0, so Acrux is worth a look if you want straightforward, reusable utilities to support Perl applications.
Business-NAB
Release | 13 Aug 2026 08:08 AM | Author: LEEJO | Version: 0.09
Top level namespace for the various NAB file formats
Business::NAB is a Perl namespace that bundles a set of modules for reading and creating the file formats used to exchange payments and reports with the National Australia Bank. The top‑level package itself does not implement logic but links to focused modules for BPAY batch payments and remittance files, Australian Direct Entry payments, returns and reports, account information (NAI/BAI2) files, and XML acknowledgements. A companion Types package provides reusable type constraints for the namespace. Use this distribution when you need to build, parse, or validate NAB interchange files from Perl, and note the project is open source with source and contribution information available on GitHub.
Objects representing things found in the Kubernetes API
IO::K8s provides typed Perl objects and serialization tools that model the Kubernetes API so you can build, validate, serialize and deserialize Kubernetes resources with correct JSON types and predictable structure. It lets you create API objects programmatically, inflate JSON or Perl hashes into typed objects, load and validate YAML manifests (including multi-document files), export to YAML or JSON, and extend support for Custom Resource Definitions either by writing small APIObject-based classes or by auto-generating classes from a cluster OpenAPI spec. The module also supports pluggable resource maps so third-party CRD providers like Cilium can be merged in, and it includes a compact Perl DSL for manifest files (.pk8s) when you prefer code over YAML. IO::K8s uses Moo for light, fast classes and is designed to work with Kubernetes::REST for sending requests to clusters. Noteworthy in the recent 1.105 release is the removal of legacy individual *List classes in favor of the unified IO::K8s::List and a full sync to Kubernetes v1.36 plus related CRD provider updates; if you still depend on the old list class names install IO::K8s::Deprecated for compatibility guidance.
CXC-Astro-Regions
Release | 12 Aug 2026 10:34 PM | Author: DJERIUS | Version: 0.04
Astronomical region support
CXC::Astro::Regions is a Perl library for describing and manipulating the geometric "regions" astronomers use to mark sources and areas of interest in image and data analysis, making it easy to generate DS9, CIAO, and CFITSIO style region descriptions from Perl code or to convert between those formats. It targets common tasks such as building region files, applying region-based filters to data, and integrating region definitions into processing pipelines, and it includes format-specific helpers (CXC::Astro::Regions::DS9, ::CIAO, ::CFITSIO) so you can produce output compatible with popular astronomy tools. A recent enhancement adds CFITSIO support for using circle, box, and ellipse regions as FITS row-filter functions with extra parameters for column names, and note that a prior release renamed several DS9 parameter names which may require updating older scripts.
Perl-Critic-Policy-PreferredModules
Release | 12 Aug 2026 09:16 PM | Author: ATOOMIC | Version: 0.005
Provide custom package recommendations
Perl::Critic::Policy::PreferredModules is a configurable Perl::Critic policy that lets teams declare which modules should be preferred, discouraged, or banned and optionally provide replacement suggestions and explanations. You enable it from your .perlcriticrc and point it at a Config::INI file where each section names a module or a builtin function and can include keys like prefer, reason, severity and message, plus a for list to limit a recommendation to specific functions. The policy understands partial replacements so you can recommend a writer-only drop-in while leaving readers alone and it inspects import lists and actual calls to determine whether a use of a module or a builtin should be reported. It also handles parent/base and conditional loads via use if so those cases are not silently missed. To be precise about whether a preferred module actually exports a symbol the policy may load that module or parse its source as a fallback, which requires running Perl::Critic with the --allow-unsafe flag for the loading behavior to be enabled, otherwise the policy is skipped for those checks.
Music-Scales
Release | 12 Aug 2026 07:20 PM | Author: GENE | Version: 0.11
Upvotes: 2 | CPAN Testers: Pass 100.0%
Generate musical scales
Music::Scales generates musical scales from a given keynote and scale name and returns them as note names, MIDI note numbers, PDL-format strings, or as semitone-offset hashes. It supports ascending and descending forms for direction-sensitive scales such as melodic minor and recognizes about 30 built-in scales and modes with abbreviated name lookup. The module attempts sensible enharmonic spellings based on the key, offers a user override for sharp or flat preference, exports its functions and core scale lists by default, and includes an is_scale helper to validate names. Recent updates focused on documentation and packaging while earlier releases added MIDI and PDL output. The author notes a few remaining enharmonic edge cases.
PAGI-FastAPI-RateLimit-Driver-Redis
Release | 12 Aug 2026 06:22 PM | Author: MANWAR | Version: v0.1.0
Redis Storage Driver for PAGI::FastAPI Rate Limiting
PAGI::FastAPI::RateLimit::Driver::Redis is a Redis-backed storage driver that lets PAGI::FastAPI rate-limiting middleware keep centralized hit counts across multiple workers or servers. It requires you to pass an existing Redis client and works with common clients such as Redis, Redis::Fast, or Mojo::Redis. The driver uses Lua scripts so increments and TTL setup are performed atomically, which prevents race conditions during heavy concurrent request bursts. Its async API returns Futures and provides increment_async to atomically bump a counter and set the TTL for new buckets, get_async to read the current count without touching the TTL, and reset_async to delete a bucket. You can also configure a key_prefix to namespace keys, making this a good choice when you need consistent, high-performance rate limiting for clustered Perl web applications.
PAGI-FastAPI-RateLimit-Driver-CHI
Release | 12 Aug 2026 06:19 PM | Author: MANWAR | Version: v0.0.1
CHI Storage Driver for PAGI::FastAPI Rate Limiting
PAGI::FastAPI::RateLimit::Driver::CHI is a storage driver that plugs CHI-backed caches into PAGI::FastAPI's rate-limiting middleware so you can use Memcached, Redis, file caches or any other CHI-supported backend to store and share request counters across worker processes and distributed nodes. It expects an initialized CHI instance and accepts an optional key_prefix (defaults to 'pagi_rl:') to avoid namespace clashes. The driver provides async-compatible methods to increment, read and reset counters that return Future objects so it integrates with PAGI's async pipeline, but because CHI itself is synchronous slow or blocking backends can block your event loop so consider a native async driver like the Redis driver for very high concurrency. This is the module's initial CPAN release (v0.0.1).
PAGI-FastAPI
Release | 12 Aug 2026 06:11 PM | Author: MANWAR | Version: v1.0.0
Asynchronous, Type-Safe Micro-Framework with Dependency Injection and OpenAPI & Swagger UI
PAGI::FastAPI is an asynchronous micro-framework for modern Perl (5.36+) inspired by Python FastAPI that makes it easy to build non-blocking, type-checked web services. It blends the PAGI async protocol with Future::AsyncAwait so route handlers can be written as async subs and it validates query parameters and JSON/form bodies using Type::Tiny before your handler runs. The framework includes dependency injection and middleware hooks, builtin support for WebSockets and Server-Sent Events, automatic OpenAPI 3.1 generation with an interactive Swagger UI, and convenience features like CORS, CSRF, rate limiting, bot protection, and mounting of sub-apps. Authentication is intentionally left pluggable and the companion PAGI::FastAPI::Security distribution provides ready-made credential extractors. You compile your app into a PAGI-compatible async code reference for servers or testing. Note that the framework is loop-agnostic by design but you may need to take care when integrating libraries that use a different event loop, such as Mojo::IOLoop, to avoid blocking or reactor mismatches.
JSON-Schema-Modern
Release | 12 Aug 2026 05:03 PM | Author: ETHER | Version: 0.643
Upvotes: 10 | CPAN Testers: Pass 100.0%
Validate data against a schema using a JSON Schema
JSON::Schema::Modern is a Perl evaluator and validator for JSON Schema that implements the current draft 2020-12 and earlier drafts so you can check Perl data structures or JSON strings against rich, standards-compliant schemas. It supports configurable output formats, short-circuiting, collection of annotations, applying default values back into results, and extension points for custom formats, media types, encodings and vocabularies so you can adapt validation to OpenAPI or other ecosystems. You load or register schema documents into the evaluator and reuse or cache them for performance, and helper methods let you traverse and validate schemas as well as fetch resolved schema fragments. The distribution does not automatically fetch schemas from disk or the network so referenced documents must be added explicitly and some format validators rely on optional CPAN modules, and the module warns that pattern and regex evaluation can be dangerous with untrusted schemas. In the latest updates the package improved application/x-www-form-urlencoded handling to be spec compliant, added a canonicalize_uri utility, and tightened validate_schema to respect format constraints.
Punk-Queue
Release | 12 Aug 2026 04:23 PM | Author: LNATION | Version: 0.03
A job queue for Perl, with a C core
Punk::Queue is a durable, database-backed job queue for Perl that implements its hot paths in C for speed and atomicity. Jobs are stored as rows in SQLite or PostgreSQL and are claimed and recorded by multiple worker processes so work survives crashes and restarts. It provides a rich enqueue API with priority, delay, dependencies, uniqueness keys, per-queue and per-task defaults, and a worker runtime that atomically dequeues, performs and records results or failures. Retries use randomized exponential backoff to avoid thundering herds and three layers of timeout handling protect the system while the supervisor can forcibly kill long-running children. The queue preserves a full per-job log across attempts, offers migration and schema versioning, a repair action to tidy crashed state, simple leasing and counted locks, broadcasting to workers, and admin-friendly listing and stats endpoints. Because Punk::Queue delivers at-least-once semantics tasks must be idempotent by design. This is the initial 0.01 release.
A MVC web framework
Punk is a lightweight, performance-focused MVC web framework for Perl that compiles and freezes routes, guard chains, handlers, helpers and mounts at to_app time so dispatch is a simple fast lookup with no per-request interpretation. It gives a compact DSL for HTTP routes plus WebSocket and Server-Sent Events endpoints, guard scopes, static mounts, view engines, model backends and plugins and can mount OpenAPI 3.1 specs to auto-generate controller stubs and validate requests. Built-in features include signed cookie sessions, single-use CSRF tokens, CORS handling, an outbound user agent per worker and an async-friendly runtime based on futures so handlers can await work without pinning a worker when run on an evented server such as Hyperman. The distribution ships a generator that scaffolds a running app, plus CLI commands for development, route inspection and config checking, and it supports non-blocking model backends like DBIx::Loop. Recent fixes in 0.05 addressed a segfault on older Perls and updated dependency minimums to improve installability.
Template-Stencil
Release | 12 Aug 2026 04:01 PM | Author: LNATION | Version: 0.05
A fast template engine
Template::Stencil is a high‑performance Perl template engine that compiles a compact {% %} template grammar into packed bytecode and renders it with a C interpreter to produce a ready‑to‑send scalar buffer. It provides variable output with automatic HTML escaping and a raw opt‑out, chained filters (built‑in and user‑registered), conditionals, nested loops with rich loop metadata, scoped set bindings, static includes, and a single‑pass wrapper/layout mechanism so you can render pages and layouts without intermediate strings. Templates are cached and revalidated by mtime for files or by content hash for string templates and the engine is tuned for minimal per‑render allocations and system calls to maximize throughput. Options let you control auto escaping, strict mode, deterministic hash ordering, UTF‑8 handling and an optional HTML pretty step via an external formatter. The design fits prefork and threaded deployments because each interpreter owns its engine and XS consumers can call the engine directly through a C ABI. Caveats to note are that templates cannot call methods on blessed objects, hash key iteration is sorted by default, and several advanced features such as dynamic include names, arithmetic in expressions and streaming renders are reserved for future releases. Use Template::Stencil when you want a fast, predictable and escape‑safe templating solution for Perl web output.
Markdown-Simple
Release | 12 Aug 2026 03:22 PM | Author: LNATION | Version: 0.21
CPAN Testers: Pass 100.0%
Markdown to HTML
Markdown::Simple is a compact, high-performance XS module that converts Markdown to HTML with GitHub Flavored Markdown as the default but with options to select strict CommonMark or toggle individual features. You can use the simple functional API for one-offs or create a persistent renderer object to reuse the parser arena when converting many documents in a loop, which reduces allocation overhead and improves throughput. It supports GFM extras like tables, strikethrough, task lists and autolinks, offers a strip_markdown helper to produce plain text, and can optionally syntax-highlight fenced code blocks when Eshu is present. Recent releases added GitHub-style heading ids and a render_with_toc method that returns the document headings for building a table of contents, fixed several memory leaks and platform load issues, and include SIMD acceleration and a small C ABI for embedding in other code. Keep in mind the renderer is not safe to run concurrently in the same interpreter so use one session per thread or worker.
DBIx-Loop
Release | 12 Aug 2026 03:18 PM | Author: LNATION | Version: 0.03
CPAN Testers: Pass 100.0%
Non-blocking DBI on your event loop
DBIx::Loop lets you run DBI database work without stalling an event loop by presenting a single future-based API that offloads blocking drivers to a worker pool or uses a native non-blocking path when available (DBD::Pg). You always provide the event loop adapter (IO::Async, Mojo::IOLoop, AnyEvent, Hyperman, etc.) and then use query and do to get immediate futures, use txn to run a block pinned to one connection, and call the async variants of DBI's select* helpers; results come back as simple data structures so you can compose continuations or bridge into your loop's await mechanism. This module is designed for concurrency and latency isolation in event-driven servers rather than micro-optimizing a single query, and it supports common needs like cached prepares, max-queue backpressure, and safe pool behavior across forks. Noteworthy in the recent 0.02 release are robustness and integration improvements: pool-worker death and fork-safety bugs were fixed, selectall_rowhash was added to preserve row ordering as hashrefs, and a public C ABI was introduced so XS code can efficiently drive DBIx::Loop futures. If you need non-blocking DBI behavior inside your evented application and are prepared to supply or adapt a loop, DBIx::Loop is a practical, production-minded choice.
Search-Trigram
Release | 12 Aug 2026 03:15 PM | Author: LNATION | Version: 0.03
Trigram inverted index search with Dice coefficient scoring
Search::Trigram provides a compact, in-memory trigram inverted index that makes fuzzy text lookup fast and simple. You add UTF-8 documents and the module indexes overlapping three-character slices so queries are scored by the Dice coefficient over shared trigrams, with case-insensitive, byte-level UTF-8 matching. The search method returns a list of hits as {doc_id, score, text} sorted by score and accepts an optional result limit, and you can remove documents, run optimize to purge deletions and compact postings, and query document and trigram counts. The distribution also exposes a stable C ABI so XS modules or C code can drive the same index without a Perl frame. This module is a good fit when you need a lightweight, in-process fuzzy search layer for Perl applications or extensions.
Asynchronous redis client using hiredis and EV
EV::Redis is an asynchronous Redis client for Perl that plugs into the high-performance EV event loop and uses the native hiredis library for fast, nonblocking I/O. It is a drop-in successor to EV::Hiredis and adds practical features you will care about in real services such as automatic reconnection, command and connect timeouts, flow control for high-throughput workloads, TLS support, RESP3 push handling for server-initiated messages, and a fire-and-forget mode for very fast writes. The API is simple and callback-driven so you connect, send commands and receive replies without blocking your event loop, and it also works under AnyEvent when EV is used as the backend. Be aware that EV::Redis treats all strings as raw bytes and does not perform UTF-8 encoding or decoding for you, so encode and decode your text explicitly, and note a few protocol caveats such as monitor mode needing a dedicated connection and sharded pub/sub not being supported. This release updates the bundled hiredis to v1.4.1 to address security issues in deeply nested replies and related parsing limits, while preserving the module's focus on low-latency, evented Redis access.
HTTP/2 Future-based user agent
Fetch is a modern, high-performance Perl HTTP client that makes both simple synchronous calls and large-scale concurrent requests easy. Its performance-critical networking, TLS and HTTP/2 framing are implemented in bundled C while the Perl API returns Fetch::Future objects so you can either await results with ->get or drive many requests concurrently on an event loop; a built-in standalone loop is used automatically if you do not supply one. It supports HTTP/1.1 and HTTP/2 with ALPN, keep-alive connection pooling, redirect following, per-request timeouts, cookie jars, JSON helpers and native WebSockets, and it provides streaming callbacks for headers and body chunks to handle large downloads or server-sent events without buffering everything. You can set default headers and per-request overrides, clone agents to share pools while isolating cookies, opt into a lean simple_response mode for extreme throughput, and even use a small C ABI so XS modules can issue requests with minimal Perl overhead. If you want a capable, efficient HTTP/2-ready client for both ad-hoc scripting and high-concurrency applications, Fetch is a strong choice.
Schedule-Activity
Favorite | 12 Aug 2026 02:09 PM | Author: BBLACKM | Version: 0.3.0
Generate activity schedules
Schedule::Activity generates randomized, time-based activity schedules by assembling activities from sequences of actions defined in a configuration graph. You declare named nodes with time specs (tmmin, tmavg, tmmax), messages, attributes and next-node links which may include cycles and weighted choices, and the scheduler grows each activity stepwise while using configurable slack and buffer tensions to bias how closely the result meets a target time. The module records per-event messages and a detailed attribute history, supports annotations that attach secondary messages or attributes around events, and can perform goal-oriented retries that score multiple candidate schedules by attribute averages. It also supports incremental construction so you can extend an earlier schedule, offers a simple markdown importer for quick configuration, and returns validation errors when configuration checks fail. This is a good fit when you need realistic, variable-duration schedules for simulation, testing, scenario generation or any situation where controlled randomness and attribute tracking matter rather than exact optimization. Note that it is a randomized opportunistic generator and not a path optimizer, schedules may fail if actions lack slack or buffer, and setting tmavg to zero can lead to infinite loops.
Net-MQTT-Simple
Favorite | 12 Aug 2026 02:09 PM | Author: JUERD | Version: 1.33
Minimal MQTT version 3 interface
Net::MQTT::Simple is a tiny, dependency free Perl MQTT v3 client aimed at simple sensor scripts and embedded installs where you cannot pull in CPAN modules. It offers both a lightweight functional API for one off publishes and gets and a small object API that supports subscribing and an event loop, plus convenience features like last will and optional login. Connections are opened on demand and automatically reconnect with failures reported as warnings rather than exceptions so unattended scripts keep running. It intentionally implements only the basics so every message is fire and forget at QoS 0, large messages are rejected, and incoming packets are not exhaustively validated, so it is not suitable for heavy production brokers or advanced MQTT features. There are a few practical caveats such as a single reconnection attempt cadence, a requirement to handle message encoding yourself since messages are treated as binary, and optional IPv6 support if IO::Socket::IP is installed. If you need a minimal, easy to install MQTT client for simple telemetry or automation this module fits well and you can move to Net::MQTT or Net::MQTT::Simple::SSL when you need more features or encryption.
Data-TopK-Shared
Release | 12 Aug 2026 02:03 PM | Author: EGOR | Version: 0.04
Shared-memory top-k heavy hitters (Space-Saving, optional time decay)
Data::TopK::Shared provides a compact, shared-memory implementation of the Space-Saving top-k heavy-hitters sketch for Perl, letting multiple processes track the most frequent keys in a stream without storing a counter per distinct key. You give it a fixed capacity of counters and call add to feed keys, and it returns estimated counts with a guaranteed error bound so the true frequency lies between count minus error and count; genuine heavy hitters above seen/capacity are guaranteed to be retained. The summary can be shared across processes via a backing file, memfd, or forked anonymous mapping and uses a futex-based rwlock with dead-owner recovery to make concurrent updates safe. There is also an optional time-decayed mode that weights recent observations more heavily via a configurable half-life and reports decayed floating-point counts, a feature introduced in a recent release, and the latest update improves recovery of files left by interrupted creation. Note that this module is Linux-only, requires 64-bit Perl, truncates keys to a configurable byte length and will croak on wide-character strings unless you supply bytes, and it documents a few practical caveats such as very unlikely PID-reuse issues and an extreme reader-slot exhaustion edge case.
Data-TimingWheel-Shared
Release | 12 Aug 2026 02:03 PM | Author: EGOR | Version: 0.02
Shared-memory hashed timing wheel (O(1) timer scheduling)
Data::TimingWheel::Shared provides a compact, shared-memory timing wheel for O(1) scheduling and cancellation of large numbers of discrete-tick timers, making it useful for event loops, job schedulers, and network stacks where many timers must be managed efficiently. Timers are scheduled in integer ticks, carry an arbitrary 64-bit payload, and fire when the wheel advances; any process that opens the same backing file, inherits an anonymous mapping across fork, or reopens a memfd can schedule or cancel timers while typically a single process advances the clock and dispatches fired payloads. The module exposes simple operations to add, cancel, advance, inspect, clear, and persist the wheel, enforces fixed geometry for capacity and slot count for predictable memory usage, and uses a futex-based rwlock with dead-process recovery to keep the shared state consistent across crashes. It is Linux-only and requires 64-bit Perl, and the author documents a couple of rare caveats such as undetected PID reuse and the theoretical limit on concurrent reader slots that can make writer recovery difficult only in extreme cases. The recent 0.02 release improves robustness by recovering files left behind by interrupted creates and refines unlink behavior and documentation.
Data-Sync-Shared
Release | 12 Aug 2026 02:03 PM | Author: EGOR | Version: 0.08
Shared-memory synchronization primitives for Linux
Data::Sync::Shared is a Linux-only Perl module that exposes five cross-process synchronization primitives stored in mmap'd shared memory and implemented with Linux futexes for efficient blocking. It gives you a counting Semaphore for resource limits, a Barrier for N-way rendezvous, a reader-writer RWLock that supports many readers or one writer, a Condvar with a built-in mutex for predicate waiting, and a Once gate for one-time initialization. Primitives can be file-backed, anonymous for fork inheritance, or created with memfd for passing file descriptors to peers, and most blocking operations accept timeouts and offer scope-based guard objects that auto-release on scope exit. The implementation focuses on crash safety by encoding holder PIDs so other processes can detect and recover stale locks and it secures backing files by default to owner-only permissions while allowing explicit modes for shared use. There is eventfd integration for hooking into event loops and utility methods for syncing, unlinking, and diagnostics. Recent updates improve robustness by recovering files left behind by interrupted creates and hardening guard behavior across forks. Be aware of an edge case described in the docs where if more than 1024 concurrent reader processes share one mapping and a reader crashes during its tiny lock window, writers may be unable to reclaim that contribution until the mapping is recreated.
Data-Stack-Shared
Release | 12 Aug 2026 02:03 PM | Author: EGOR | Version: 0.08
Shared-memory LIFO stack for Linux
Data::Stack::Shared implements a fast, lock-free LIFO stack that multiple processes can share via anonymous mappings, memfd or a file on Linux. It comes in two typed flavors for 64-bit Perl programs: a 64-bit integer variant and a fixed-length string variant. Push and pop operations are safe for multiple producers and consumers and support blocking waits with timeouts plus a non-destructive peek. The module exposes capacity and size queries, a drain operation that is concurrency-safe, eventfd notification hooks, memfd/file management and basic statistics, and it aims for high throughput in both single- and multi-process workloads. It is Linux-only and requires 64-bit Perl, the on-disk format was bumped to v2 so very old v1 files are not compatible, and drain includes a recovery path that can reclaim a stalled writer at the cost of silently dropping a late publish. File-backed stacks default to owner-only permissions and any process granted write access to a shared mapping must be trusted not to corrupt it.
Data-SpatialHash-Shared
Release | 12 Aug 2026 02:03 PM | Author: EGOR | Version: 0.04
Shared-memory spatial hash index for Linux
Data::SpatialHash::Shared is a Linux-only, 64-bit Perl module that implements a fast, shared-memory spatial hash for concurrent processes to store and query 2D or 3D points and small values. It divides space into configurable grid cells so you can do radius, k-nearest, box, cell, and collision-broad-phase queries efficiently, and it supports bulk inserts/moves to amortize locking for high-throughput use such as game ticks or simulation steps. You can create a seamless toroidal world for wraparound metrics or enable a spherical mode that accepts lat/lon/alt and offers true 3D distance queries plus cube-sphere cell ids for chunking and LOD. The API returns opaque handles for mutating entries, offers read- and write-locking across processes with futex-based crash recovery, and provides an option to freeze a file-backed map for lock-free read-only distribution across machines of the same architecture. It also supports memfd-based anonymous mappings, eventfd notifications, and various introspection and tuning knobs like cell size and bucket count. The implementation is robust in practice but notes two edge cases to consider during extreme failure scenarios, namely possible PID-reuse interference with lock recovery and limits around 1024 reader slots that could complicate recovery if many readers crash while holding locks.
Data-SortedSet-Shared
Release | 12 Aug 2026 02:03 PM | Author: EGOR | Version: 0.05
Shared-memory sorted set (ZSET) for Linux
Data::SortedSet::Shared provides a Redis-style sorted set that lives in shared memory so multiple processes can read and write the same ordered collection of 64-bit integer members with double scores on Linux under 64-bit Perl. It stores members in a B+tree with a fast member-to-score index so lookups like score and exists are constant time while rank, insert, delete and popping extremes are logarithmic, and range scans walk linked leaves efficiently. You can back the set with a file, an anonymous mapping inherited across fork, or a transferable memfd, and there is a string-keyed variant that interns keys if you need text members. The module supports bulk inserts, incremental score updates, iteration, an eventfd-based notify mechanism for waking other processes, and a freeze mode that seals a file for lock-free, read-only distribution to other machines of the same architecture. It is Linux-only and requires 64-bit Perl. Note the documented crash-safety caveats: a writer killed mid-mutation can leave the tree structurally corrupt, PID reuse is not detected, and extremely large numbers of concurrent readers can exhaust a limited reader-slot table, so plan deployment and backups accordingly.