On Thu, Jul 19, 2001 at 09:26:22PM +0200, H.Merijn Brand wrote: > On Thu 19 Jul 2001 21:05, Craig Milo Rogers <rogers@ISI.EDU> wrote: > > >To clamp down on a hash and disallow access to nonexistant keys: > > > clamp %hash, 1 > > > > > >To unclamp: > > > clamp %hash, 0 > > > > > >To query > > > my $clamped = clamp %hash; > > > > clamp %hash; > > unclamp %hasn; > > my $clampishness = clamped %hash; > > Which would make Jeffrey's other example very tedious: > > my $prev = clamp %$ref, 0; > $ref->{NewKey} = 1; > clamp %$ref, $prev; > => > my $prev = clamped %$ref; > unclamp %$ref; > $ref->{NewKey} = 1; > $prev and clamp %$ref; > > Better? Don't think so. But it would at least be consistent with tie, tied, untie And IMO consistency matters. Graham.Thread Previous | Thread Next