BSD Ports

devel/p5-constant-defer 6 DragonFly

Constant subs with deferred value calculation

System
DragonFly
Repository
DPorts
Maintainer
[email protected] (as in FreeBSD)
License
GPLv3
Categories
devel, perl5
Package size
22.4 KiB, 54.1 KiB installed

Description

constant::defer creates a subroutine which on the first call runs given code to calculate its value, and on any subsequent calls just returns that value, like a constant. The value code is discarded once run, allowing it to be garbage collected.

Deferring a calculation is good if it might take a lot of work or produce a big result but is only needed sometimes or only well into a program run. If it's never needed then the value code never runs.

A deferred constant is generally not inlined or folded (see "Constant Folding" in perlop) since it's not a single scalar value. In the current implementation a deferred constant becomes a plain constant after the first use, so may inline etc in code compiled after that (see "IMPLEMENTATION" below).

In the other systems

The newest version among them is 6, as upstream numbers it.

SystemPortVersionVulnerabilitiesStatusMaintainerLast update
DragonFlydevel/p5-constant-defer6 newestnone known-[email protected]-
FreeBSDdevel/p5-constant-defer6 newestnone known-[email protected]-
NetBSDdevel/p5-constant-defer6nb5 newestnone known-[email protected]2026-07-16
HardenedBSDdevel/p5-constant-defer6 newestno data-[email protected]-
GhostBSDdevel/p5-constant-defer6 newestno data-[email protected]-

Compare across BSDs

Install

Binary package:

pkg install p5-constant-defer

From DPorts:

cd /usr/dports/devel/p5-constant-defer && make install clean

Dependency graph

Ports that need it on the left, what it needs to run on the right; at most 8 of each. "Dependencies" below lists them all.

Dependencies

Run dependencies 1