May 26, 2018
Make variables (im)?mutable
DataLock makes the specified variable immutable like Readonly. Unlike Readonly which implements immutability via tie, DataLock makes use of the internal flag of perl SV so it imposes almost no penalty.
Like Readonly, DataLock locks not only the variable itself but also elements therein. You can DataLock objects as well.