BSD Ports

devel/p5-constant-defer 6 FreeBSD

Constant subs with deferred value calculation

System
FreeBSD
Repository
FreeBSD ports
Maintainer
[email protected]
License
GPLv3
Categories
devel, perl5
Package size
23.1 KiB, 53.8 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
FreeBSDdevel/p5-constant-defer6 newestnone known-[email protected]-
NetBSDdevel/p5-constant-defer6nb5 newestnone known-[email protected]2026-07-16
DragonFlydevel/p5-constant-defer6 newestnone known-[email protected]-
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 the ports tree:

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

To depend on this port in another port's Makefile:

RUN_DEPENDS=	p5-constant-defer>0:devel/p5-constant-defer

Packages

The version each package repository carries. “-” means the repository builds no package of it, “n/a” that there is no such repository.

Repositoryaarch64amd64armv6armv7i386
FreeBSD:14:latest66666
FreeBSD:14:quarterly66n/a66
FreeBSD:15:latest66n/a66
FreeBSD:15:quarterly66n/an/an/a
FreeBSD:16:latest66n/an/an/a
FreeBSD:16:quarterlyn/an/an/an/an/a

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

The Makefile names none itself; they come from USES and USE_*.

The full lists below include those, and their dependencies in turn.

Build dependencies 1
Run dependencies 1

Configuration

No options to configure.

USES
perl5
Service scripts
none

Files

pkg-plist 2
  • %%SITE_PERL%%/constant/defer.pm
  • %%PERL5_MAN3%%/constant::defer.3.gz
distinfo 1
FileSizeSHA256
constant-defer-6.tar.gz434277b21263198ca22686efff3ae987a240be423dd2160afdeb29fe716d032986ffa
Master sites 1
  • CPAN

Commit history 0

No commits in the history this site was built from.