in reply to Advice on Global Constants
Next you could consider restricting the key set of a hash via Hash::Util, or using accessors, probably as lvalue subs, e.g.
sub this_id :lvalue { $_[0]->{this_id} = $_[1] if @_ > 1; $_[0]->{this_id}; }
Then you can say
$r->thisid = 10;
but for this notation, $r has to be blessed into the package this constant lvalue sub is defined in.
update: corrected sub
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
|
|---|