Even more simplifications of the PP callback
[p5sagit/namespace-clean.git] / lib / namespace / clean / _PP_OSE_5_8.pm
1 package # hide from the pauses
2   namespace::clean::_PP_OSE_5_8;
3
4 use warnings;
5 use strict;
6
7 # This is the original implementation, which sadly is broken
8 # on perl 5.10+ withing string evals
9 sub on_scope_end (&) {
10   $^H |= 0x020000;
11
12   push @{
13     $^H{'__namespace::clean__guardstack__'}
14       ||= bless ([], 'namespace::clean::_PP_SG_STACK')
15   }, shift;
16 }
17
18 package # hide from the pauses
19   namespace::clean::_PP_SG_STACK;
20
21 use warnings;
22 use strict;
23
24 sub DESTROY { $_->() for @{$_[0]} }
25
26 1;