in reply to Re^2: Constants refferences
in thread Constants refferences

This is one place where Readonly shines. You can create your variables, initialize them and then mark as read only.

Also worth noting is that arrays and hash references point to data structures that can be modified. This is covered in the constant perldoc.

I have found constants useful for simple things like naming array indexes data structures. Otherwise, if I need to be sure a data-structure is immutable, I use Readonly or lock hashes using Hash::Util, depending on the complexity of the structure.


TGI says moo