1 package # hide from the pauses
2 namespace::clean::_PP_OSE;
8 use Hash::Util::FieldHash 'fieldhash';
10 # Here we rely on a combination of several behaviors:
12 # * %^H is deallocated on scope exit, so any references to it disappear
13 # * A lost weakref in a fieldhash causes the corresponding key to be deleted
14 # * Deletion of a key on a tied hash triggers DELETE
16 # Therefore the DELETE of a tied fieldhash containing a %^H reference will
17 # be the hook to fire all our callbacks.
21 package # hide from pause too
22 namespace::clean::_TieHintHashFieldHash;
23 use base 'Tie::StdHash';
25 my $ret = shift->SUPER::DELETE(@_);
31 sub on_scope_end (&) {
34 tie(%hh, 'namespace::clean::_TieHintHashFieldHash')
37 push @{ $hh{\%^H} ||= [] }, shift;