in reply to hash and constants
That is not a constant hash, that is a constant reference to a hash:
use strict; use warnings; use constant GROUPS => { A => 1, B => 2, C => 3 }; GROUPS->{B} = 22; GROUPS->{D} = 'Not a constant!'; use Data::Dumper; warn Dumper [GROUPS]; __END__ $VAR1 = [ { 'A' => 1, 'D' => 'Not a constant!', 'C' => 3, 'B' => 22 } ];
Update: have a look at Readonly
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: hash and constants
by Anonymous Monk on Nov 19, 2009 at 23:30 UTC |