in reply to Re: Constants and arrow notation.
in thread Constants and arrow notation.
I guess perrin is talking about Hash::Util, with this, it lets you lock hash keys. One example as how to use that module:
use Data::Dumper; use Hash::Util; use strict; use warnings; my $constants; $constants->{CONST_ABXCDEFG} = 1; $constants->{CONST_ABCXDEFG} = 2; $constants->{CONST_ABCDXEFG} = 3; $constants->{CONST_ABCDEXFG} = 4; $constants->{CONST_ABCDEFXG} = 5; Hash::Util::lock_keys(%{$constants}); print Dumper($constants); $constants->{CONST_ABCDEFGX} = 6;
|
|---|