freebsd-ports/devel/p5-Data-Lock/pkg-descr
Adam Weinberger 5d24f713e1 Add devel/p5-Data-Lock, a facility to mark variables as immutable. It is
comparable to p5-Readonly (but much faster; see
https://metacpan.org/pod/Data::Lock#BENCHMARK), or to the constant
pragma (except it retains sigils). It includes Data::Lock and its
dlock() function which handles scalars, and Attribute::Constant which
exports a ': Constant' attribute, which is faster but has caveats.
2015-03-17 16:51:19 +00:00

8 lines
373 B
Text

Data::Lock makes the specified variable immutable like Readonly. Unlike Readonly
which implements immutability via tie, Data::Lock makes use of the internal flag
of perl SV so it imposes almost no penalty.
Like Readonly, Data::Lock locks not only the variable itself but also elements
therein. You can Data::Lock objects as well.
WWW: https://metacpan.org/pod/Data::Lock