in reply to Constants and arrow notation.

Maybe hashes with fixed keys would be a better approach here than constants.

Replies are listed 'Best First'.
Re^2: Constants and arrow notation.
by pg (Canon) on Oct 28, 2004 at 21:09 UTC

    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;