diff -Nru libnamespace-clean-perl-0.21/Changes libnamespace-clean-perl-0.22/Changes --- libnamespace-clean-perl-0.21/Changes 2011-08-03 21:46:30.000000000 +0000 +++ libnamespace-clean-perl-0.22/Changes 2011-12-26 12:59:44.000000000 +0000 @@ -1,3 +1,21 @@ + [0.22] (official fix of all the %^H ickyness) + - Simplify the >= 5.10 PP variant even more - move the hook from + DESTROY into DELETE + - Force explicit callback invocation order on 5.8 PP + + [0.21_02] + - Replace the %^H tie approach with fieldhashes, fixes all known + corner cases and caveats on supported perls >= 5.8.1 (FC) + - Compile away the debugger fixup on perls >= 5.15.5 (FC) + + [0.21_01] + - More robust handling of the tied %^H in pure perl mode (RT#73402) + - Limit the debugger workarounds to perls between 5.8.8 and 5.14, + extend debugger support to all perl versions (FC) (RT#69862) + - If possible, automatically install (but not load) the debugger + workaround libraries on perls between 5.8.8 and 5.14 (RT#72368) + - Add back dropped NAME section (RT#70259) + [0.21] - When using the tie() fallback ensure we do not obliterate a foreign tie() diff -Nru libnamespace-clean-perl-0.21/debian/changelog libnamespace-clean-perl-0.22/debian/changelog --- libnamespace-clean-perl-0.21/debian/changelog 2011-08-14 10:08:30.000000000 +0000 +++ libnamespace-clean-perl-0.22/debian/changelog 2011-12-26 19:40:53.000000000 +0000 @@ -1,3 +1,13 @@ +libnamespace-clean-perl (0.22-1) unstable; urgency=low + + * Team upload + * New upstream release + * Update upstream copyright holders + * Drop pod-whatis.diff patch (fixed upstream) + * Update DEP-5 formatting a bit + + -- Alessandro Ghedini Mon, 26 Dec 2011 18:51:59 +0100 + libnamespace-clean-perl (0.21-2) unstable; urgency=low * Restore (build-)dep on libsub-name-perl, libsub-identify-perl (>= 0.04). diff -Nru libnamespace-clean-perl-0.21/debian/copyright libnamespace-clean-perl-0.22/debian/copyright --- libnamespace-clean-perl-0.21/debian/copyright 2011-08-14 09:51:30.000000000 +0000 +++ libnamespace-clean-perl-0.22/debian/copyright 2011-12-26 19:40:53.000000000 +0000 @@ -1,10 +1,11 @@ -Format: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=166 -Upstream-Contact: Robert Sedlacek +Format-Specification: http://anonscm.debian.org/viewvc/dep/web/deps/dep5.mdwn?view=markup&pathrev=135 +Maintainer: Robert Sedlacek Source: http://search.cpan.org/dist/namespace-clean/ -Upstream-Name: namespace-clean +Name: namespace-clean Files: * Copyright: 2011, Robert Sedlacek + 2011, Father Chrysostomos License: Artistic or GPL-1+ Files: debian/* diff -Nru libnamespace-clean-perl-0.21/debian/patches/pod-whatis.diff libnamespace-clean-perl-0.22/debian/patches/pod-whatis.diff --- libnamespace-clean-perl-0.21/debian/patches/pod-whatis.diff 2011-08-14 10:08:20.000000000 +0000 +++ libnamespace-clean-perl-0.22/debian/patches/pod-whatis.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -Subject: Add NAME section to POD -Origin: vendor -Bug: http://rt.cpan.org/Ticket/Display.html?id=70259 -Forwarded: yes -From: Ansgar Burchardt -Last-Update: 2011-08-14 - ---- a/lib/namespace/clean.pm -+++ b/lib/namespace/clean.pm -@@ -91,6 +91,10 @@ - } - } - -+=head1 NAME -+ -+namespace::clean - keep imports and functions out of your namespace -+ - =head1 SYNOPSIS - - package Foo; diff -Nru libnamespace-clean-perl-0.21/debian/patches/series libnamespace-clean-perl-0.22/debian/patches/series --- libnamespace-clean-perl-0.21/debian/patches/series 2011-08-14 09:51:30.000000000 +0000 +++ libnamespace-clean-perl-0.22/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -pod-whatis.diff diff -Nru libnamespace-clean-perl-0.21/lib/namespace/clean/_PP_OSE_5_8.pm libnamespace-clean-perl-0.22/lib/namespace/clean/_PP_OSE_5_8.pm --- libnamespace-clean-perl-0.21/lib/namespace/clean/_PP_OSE_5_8.pm 1970-01-01 00:00:00.000000000 +0000 +++ libnamespace-clean-perl-0.22/lib/namespace/clean/_PP_OSE_5_8.pm 2011-12-23 16:16:43.000000000 +0000 @@ -0,0 +1,26 @@ +package # hide from the pauses + namespace::clean::_PP_OSE_5_8; + +use warnings; +use strict; + +# This is the original implementation, which sadly is broken +# on perl 5.10+ withing string evals +sub on_scope_end (&) { + $^H |= 0x020000; + + push @{ + $^H{'__namespace::clean__guardstack__'} + ||= bless ([], 'namespace::clean::_PP_SG_STACK') + }, shift; +} + +package # hide from the pauses + namespace::clean::_PP_SG_STACK; + +use warnings; +use strict; + +sub DESTROY { $_->() for @{$_[0]} } + +1; diff -Nru libnamespace-clean-perl-0.21/lib/namespace/clean/_PP_OSE.pm libnamespace-clean-perl-0.22/lib/namespace/clean/_PP_OSE.pm --- libnamespace-clean-perl-0.21/lib/namespace/clean/_PP_OSE.pm 1970-01-01 00:00:00.000000000 +0000 +++ libnamespace-clean-perl-0.22/lib/namespace/clean/_PP_OSE.pm 2011-12-22 23:16:01.000000000 +0000 @@ -0,0 +1,40 @@ +package # hide from the pauses + namespace::clean::_PP_OSE; + +use warnings; +use strict; + +use Tie::Hash; +use Hash::Util::FieldHash 'fieldhash'; + +# Here we rely on a combination of several behaviors: +# +# * %^H is deallocated on scope exit, so any references to it disappear +# * A lost weakref in a fieldhash causes the corresponding key to be deleted +# * Deletion of a key on a tied hash triggers DELETE +# +# Therefore the DELETE of a tied fieldhash containing a %^H reference will +# be the hook to fire all our callbacks. + +fieldhash my %hh; +{ + package # hide from pause too + namespace::clean::_TieHintHashFieldHash; + use base 'Tie::StdHash'; + sub DELETE { + my $ret = shift->SUPER::DELETE(@_); + $_->() for @$ret; + $ret; + } +} + +sub on_scope_end (&) { + $^H |= 0x020000; + + tie(%hh, 'namespace::clean::_TieHintHashFieldHash') + unless tied %hh; + + push @{ $hh{\%^H} ||= [] }, shift; +} + +1; diff -Nru libnamespace-clean-perl-0.21/lib/namespace/clean.pm libnamespace-clean-perl-0.22/lib/namespace/clean.pm --- libnamespace-clean-perl-0.21/lib/namespace/clean.pm 2011-08-03 21:46:30.000000000 +0000 +++ libnamespace-clean-perl-0.22/lib/namespace/clean.pm 2011-12-26 12:56:08.000000000 +0000 @@ -1,5 +1,4 @@ package namespace::clean; -# ABSTRACT: Keep imports and functions out of your namespace use warnings; use strict; @@ -7,89 +6,35 @@ use vars qw( $STORAGE_VAR ); use Package::Stash; -our $VERSION = '0.21'; +our $VERSION = '0.22'; $STORAGE_VAR = '__NAMESPACE_CLEAN_STORAGE'; +# FIXME - all of this buggery will migrate to B::H::EOS soon BEGIN { - - use warnings; - use strict; - # when changing also change in Makefile.PL my $b_h_eos_req = '0.07'; - if (eval { + if (! $ENV{NAMESPACE_CLEAN_USE_PP} and eval { require B::Hooks::EndOfScope; B::Hooks::EndOfScope->VERSION($b_h_eos_req); 1 } ) { B::Hooks::EndOfScope->import('on_scope_end'); } - else { - eval <<'PP' or die $@; - - use Tie::Hash (); - - { - package namespace::clean::_TieHintHash; - - use warnings; - use strict; - - use base 'Tie::ExtraHash'; + elsif ($] < 5.009_003_1) { + require namespace::clean::_PP_OSE_5_8; + *on_scope_end = \&namespace::clean::_PP_OSE_5_8::on_scope_end; } - - { - package namespace::clean::_ScopeGuard; - - use warnings; - use strict; - - sub arm { bless [ $_[1] ] } - - sub DESTROY { $_[0]->[0]->() } - } - - - sub on_scope_end (&) { - $^H |= 0x020000; - - if( my $stack = tied( %^H ) ) { - if ( (my $c = ref $stack) ne 'namespace::clean::_TieHintHash') { - die <arm(shift); - } - else { - tie( %^H, 'namespace::clean::_TieHintHash', namespace::clean::_ScopeGuard->arm(shift) ); - } + else { + require namespace::clean::_PP_OSE; + *on_scope_end = \&namespace::clean::_PP_OSE::on_scope_end; } +} - 1; - -PP +=head1 NAME - } -} +namespace::clean - Keep imports and functions out of your namespace =head1 SYNOPSIS @@ -219,27 +164,58 @@ =cut +# Constant to optimise away the unused code branches +use constant FIXUP_NEEDED => $] < 5.015_005_1; +use constant FIXUP_RENAME_SUB => $] > 5.008_008_9 && $] < 5.013_006_1; +{ + no strict; + delete ${__PACKAGE__."::"}{FIXUP_NEEDED}; + delete ${__PACKAGE__."::"}{FIXUP_RENAME_SUB}; +} + +# Debugger fixup necessary before perl 5.15.5 +# +# In perl 5.8.9-5.12, it assumes that sub_fullname($sub) can +# always be used to find the CV again. +# In perl 5.8.8 and 5.14, it assumes that the name of the glob +# passed to entersub can be used to find the CV. +# since we are deleting the glob where the subroutine was originally +# defined, those assumptions no longer hold. +# +# So in 5.8.9-5.12 we need to move it elsewhere and point the +# CV's name to the new glob. +# +# In 5.8.8 and 5.14 we move it elsewhere and rename the +# original glob by assigning the new glob back to it. my $sub_utils_loaded; -my $DebuggerRename = sub { +my $DebuggerFixup = sub { my ($f, $sub, $cleanee_stash, $deleted_stash) = @_; - if (! defined $sub_utils_loaded ) { - $sub_utils_loaded = do { - my $sn_ver = 0.04; - eval { require Sub::Name; Sub::Name->VERSION($sn_ver) } - or die "Sub::Name $sn_ver required when running under -d or equivalent: $@"; - - my $si_ver = 0.04; - eval { require Sub::Identify; Sub::Identify->VERSION($si_ver) } - or die "Sub::Identify $si_ver required when running under -d or equivalent: $@"; + if (FIXUP_RENAME_SUB) { + if (! defined $sub_utils_loaded ) { + $sub_utils_loaded = do { + + # when changing version also change in Makefile.PL + my $sn_ver = 0.04; + eval { require Sub::Name; Sub::Name->VERSION($sn_ver) } + or die "Sub::Name $sn_ver required when running under -d or equivalent: $@"; + + # when changing version also change in Makefile.PL + my $si_ver = 0.04; + eval { require Sub::Identify; Sub::Identify->VERSION($si_ver) } + or die "Sub::Identify $si_ver required when running under -d or equivalent: $@"; - 1; - } ? 1 : 0; - } + 1; + } ? 1 : 0; + } - if ( Sub::Identify::sub_fullname($sub) eq ($cleanee_stash->name . "::$f") ) { - my $new_fq = $deleted_stash->name . "::$f"; - Sub::Name::subname($new_fq, $sub); + if ( Sub::Identify::sub_fullname($sub) eq ($cleanee_stash->name . "::$f") ) { + my $new_fq = $deleted_stash->name . "::$f"; + Sub::Name::subname($new_fq, $sub); + $deleted_stash->add_symbol("&$f", $sub); + } + } + else { $deleted_stash->add_symbol("&$f", $sub); } }; @@ -259,18 +235,23 @@ my $sub = $cleanee_stash->get_symbol("&$f") or next SYMBOL; - if ($^P and ref(\$cleanee_stash->namespace->{$f}) eq 'GLOB') { - # convince the Perl debugger to work - # it assumes that sub_fullname($sub) can always be used to find the CV again - # since we are deleting the glob where the subroutine was originally - # defined, that assumption no longer holds, so we need to move it - # elsewhere and point the CV's name to the new glob. - $DebuggerRename->( - $f, - $sub, - $cleanee_stash, - $deleted_stash ||= Package::Stash->new("namespace::clean::deleted::$cleanee"), - ); + my $need_debugger_fixup = + FIXUP_NEEDED + && + $^P + && + ref(my $globref = \$cleanee_stash->namespace->{$f}) eq 'GLOB' + ; + + if (FIXUP_NEEDED && $need_debugger_fixup) { + # convince the Perl debugger to work + # see the comment on top of $DebuggerFixup + $DebuggerFixup->( + $f, + $sub, + $cleanee_stash, + $deleted_stash ||= Package::Stash->new("namespace::clean::deleted::$cleanee"), + ); } my @symbols = map { @@ -281,6 +262,13 @@ $cleanee_stash->remove_glob($f); + # if this perl needs no renaming trick we need to + # rename the original glob after the fact + # (see commend of $DebuggerFixup + if (FIXUP_NEEDED && !FIXUP_RENAME_SUB && $need_debugger_fixup) { + *$globref = $deleted_stash->namespace->{$f}; + } + $cleanee_stash->add_symbol(@$_) for @symbols; } }; @@ -434,17 +422,6 @@ Just for completeness sake, if you want to remove the symbol completely, use C instead. -=head1 CAVEATS - -This module is fully functional in a pure-perl environment, where -L (with the XS dependency L), may -not be available. However in this case this module falls back to a -L of L<%^H|perlvar/%^H> which may or may not interfere -with some crack you may be doing independently of namespace::clean. - -If you want to ensure that your codebase is protected from this unlikely -clash, you need to explicitly depend on L. - =head1 SEE ALSO L @@ -473,11 +450,15 @@ Peter Rabbitson +=item * + +Father Chrysostomos + =back =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2011 by Robert 'phaylon' Sedlacek. +This software is copyright (c) 2011 by L This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libnamespace-clean-perl-0.21/Makefile.PL libnamespace-clean-perl-0.22/Makefile.PL --- libnamespace-clean-perl-0.21/Makefile.PL 2011-08-03 21:46:29.000000000 +0000 +++ libnamespace-clean-perl-0.22/Makefile.PL 2011-12-21 10:02:40.000000000 +0000 @@ -16,8 +16,16 @@ ); my %OPT_RUN_DEPS = (can_cc() ? ( - 'B::Hooks::EndOfScope' => '0.07', # when changing, also change version in namespace/clean.pm - is_smoker() ? ( 'Devel::Hide' => 0 ) : (), # make sure we smoke the pure-perl version + 'B::Hooks::EndOfScope' => '0.07', # when changing, also change $b_h_eos_req in namespace/clean.pm + + # these pieces are needed if using the debugger on the perl range + ($] > 5.008_008_9 && $] < 5.013_006_1) + ? ( 'Sub::Name' => '0.04', 'Sub::Identify' => '0.04' ) # when changing, also change $sn_ver and $si_ver in namespace/clean.pm + : () + , + + # make sure we smoke the pure-perl version + is_smoker() ? ( 'Devel::Hide' => 0 ) : (), ) : () ); my %META_BITS = ( diff -Nru libnamespace-clean-perl-0.21/MANIFEST libnamespace-clean-perl-0.22/MANIFEST --- libnamespace-clean-perl-0.21/MANIFEST 2011-08-03 21:47:46.000000000 +0000 +++ libnamespace-clean-perl-0.22/MANIFEST 2011-12-26 12:59:53.000000000 +0000 @@ -1,5 +1,7 @@ Changes lib/namespace/clean.pm +lib/namespace/clean/_PP_OSE.pm +lib/namespace/clean/_PP_OSE_5_8.pm Makefile.PL MANIFEST This list of files t/00-basic.t @@ -10,7 +12,9 @@ t/05-explicit-cleanee.t t/05-syntax-error.t t/06-other-types.t +t/07-debugger.t t/08-const-sub.t +t/09-fiddle-hinthash.t t/10-pure-perl.t t/lib/CleaneeBridge.pm t/lib/CleaneeBridgeDirect.pm @@ -22,5 +26,5 @@ t/lib/OtherTypes.pm t/lib/SyntaxError.pm t/lib/Unimport.pm -xt/author/07-debugger.t -META.yml Module meta-data (added by MakeMaker) +META.yml Module YAML meta-data (added by MakeMaker) +META.json Module JSON meta-data (added by MakeMaker) diff -Nru libnamespace-clean-perl-0.21/META.json libnamespace-clean-perl-0.22/META.json --- libnamespace-clean-perl-0.21/META.json 1970-01-01 00:00:00.000000000 +0000 +++ libnamespace-clean-perl-0.22/META.json 2011-12-26 12:59:53.000000000 +0000 @@ -0,0 +1,50 @@ +{ + "abstract" : "Keep imports and functions out of your namespace", + "author" : [ + "Robert 'phaylon' Sedlacek , Florian Ragwitz , Jesse Luehrs " + ], + "dynamic_config" : 1, + "generated_by" : "ExtUtils::MakeMaker version 6.6302, CPAN::Meta::Converter version 2.112621", + "license" : [ + "perl_5" + ], + "meta-spec" : { + "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", + "version" : "2" + }, + "name" : "namespace-clean", + "no_index" : { + "directory" : [ + "t", + "inc" + ] + }, + "prereqs" : { + "build" : { + "requires" : { + "Test::More" : "0.88" + } + }, + "configure" : { + "requires" : { + "ExtUtils::MakeMaker" : 0 + } + }, + "runtime" : { + "requires" : { + "Package::Stash" : "0.23" + } + } + }, + "release_status" : "stable", + "resources" : { + "bugtracker" : { + "web" : "http://rt.cpan.org/Public/Dist/Display.html?Name=namespace-clean" + }, + "homepage" : "http://search.cpan.org/dist/namespace-clean", + "repository" : { + "url" : "git://git.shadowcat.co.uk/p5sagit/namespace-clean.git" + } + }, + "version" : "0.22" +} diff -Nru libnamespace-clean-perl-0.21/META.yml libnamespace-clean-perl-0.22/META.yml --- libnamespace-clean-perl-0.21/META.yml 2011-08-03 21:47:46.000000000 +0000 +++ libnamespace-clean-perl-0.22/META.yml 2011-12-26 12:59:53.000000000 +0000 @@ -1,26 +1,26 @@ ---- #YAML:1.0 -name: namespace-clean -version: 0.21 -abstract: Keep imports and functions out of your namespace +--- +abstract: 'Keep imports and functions out of your namespace' author: - - Robert 'phaylon' Sedlacek , Florian Ragwitz , Jesse Luehrs -license: perl -distribution_type: module -configure_requires: - ExtUtils::MakeMaker: 0 + - "Robert 'phaylon' Sedlacek , Florian Ragwitz , Jesse Luehrs " build_requires: - Test::More: 0.88 + Test::More: 0.88 +configure_requires: + ExtUtils::MakeMaker: 0 +dynamic_config: 1 +generated_by: 'ExtUtils::MakeMaker version 6.6302, CPAN::Meta::Converter version 2.112621' +license: perl +meta-spec: + url: http://module-build.sourceforge.net/META-spec-v1.4.html + version: 1.4 +name: namespace-clean +no_index: + directory: + - t + - inc requires: - Package::Stash: 0.23 + Package::Stash: 0.23 resources: - bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=namespace-clean - homepage: http://search.cpan.org/dist/namespace-clean - repository: git://git.shadowcat.co.uk/p5sagit/namespace-clean.git -no_index: - directory: - - t - - inc -generated_by: ExtUtils::MakeMaker version 6.57_05 -meta-spec: - url: http://module-build.sourceforge.net/META-spec-v1.4.html - version: 1.4 + bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=namespace-clean + homepage: http://search.cpan.org/dist/namespace-clean + repository: git://git.shadowcat.co.uk/p5sagit/namespace-clean.git +version: 0.22 diff -Nru libnamespace-clean-perl-0.21/t/07-debugger.t libnamespace-clean-perl-0.22/t/07-debugger.t --- libnamespace-clean-perl-0.21/t/07-debugger.t 1970-01-01 00:00:00.000000000 +0000 +++ libnamespace-clean-perl-0.22/t/07-debugger.t 2011-12-21 09:50:20.000000000 +0000 @@ -0,0 +1,39 @@ +use Test::More; + +BEGIN { + # shut up the debugger + $ENV{PERLDB_OPTS} = 'NonStop'; + + # work aroud the regex + P::S::XS buggery on + # < 5.8.6 + require Package::Stash; +} + +BEGIN { + +#line 1 +#!/usr/bin/perl -d +#line 10 + +} + +{ + package Foo; + + BEGIN { *baz = sub { 42 } } + sub foo { 22 } + + use namespace::clean; + + sub bar { + ::is(baz(), 42); + ::is(foo(), 22); + } +} + +ok( !Foo->can("foo"), "foo cleaned up" ); +ok( !Foo->can("baz"), "baz cleaned up" ); + +Foo->bar(); + +done_testing; diff -Nru libnamespace-clean-perl-0.21/t/09-fiddle-hinthash.t libnamespace-clean-perl-0.22/t/09-fiddle-hinthash.t --- libnamespace-clean-perl-0.21/t/09-fiddle-hinthash.t 1970-01-01 00:00:00.000000000 +0000 +++ libnamespace-clean-perl-0.22/t/09-fiddle-hinthash.t 2011-12-22 11:07:06.000000000 +0000 @@ -0,0 +1,53 @@ +use strict; +use warnings; + +use Test::More 0.88; + +{ + package Bar; + use sort 'stable'; + use namespace::clean; + use sort 'stable'; + { + 1; + } + + Test::More::pass('no segfault'); +} + +{ + package Foo; + BEGIN { + $^H{'foo'} = 'bar'; + } + + use namespace::clean; + + BEGIN { + Test::More::is( $^H{'foo'}, 'bar', 'compiletime hinthash intact after n::c' ); + } + + { + BEGIN { + Test::More::is( + $^H{'foo'}, 'bar', 'compile-time hinthash intact in inner scope' + ); + } + 1; + } + + BEGIN { + SKIP: { + Test::More::skip( + 'Tied hinthash values not present in extended caller() on perls older than 5.10' + .', regardless of mode (PP or XS)', + 1 + ) if ($] < 5.010_000); + package DB; + Test::More::is( ( (caller(0))[10] || {} )->{foo}, 'bar', 'hinthash values visible in caller' ); + } + } +} + + +done_testing; diff -Nru libnamespace-clean-perl-0.21/t/10-pure-perl.t libnamespace-clean-perl-0.22/t/10-pure-perl.t --- libnamespace-clean-perl-0.21/t/10-pure-perl.t 2011-07-31 03:32:06.000000000 +0000 +++ libnamespace-clean-perl-0.22/t/10-pure-perl.t 2011-12-22 11:20:21.000000000 +0000 @@ -2,11 +2,15 @@ use warnings; use Test::More; +plan skip_all => "PP tests already executed" + if $ENV{NAMESPACE_CLEAN_USE_PP}; + eval { require B::Hooks::EndOfScope } or plan skip_all => "PP tests already executed"; -eval { require Devel::Hide } - or plan skip_all => "Devel::Hide required for this test in presence of B::Hooks::EndOfScope"; +# the PP tests will run either wih D::H (mainly on smokers) +# or by setting the envvar (for users) +my $has_d_h = eval { require Devel::Hide }; use Config; use FindBin qw($Bin); @@ -22,7 +26,12 @@ next if $fn =~ /${this_file}$/; local $ENV{DEVEL_HIDE_VERBOSE} = 0; - my @cmd = ( $^X, '-MDevel::Hide=B::Hooks::EndOfScope', $fn ); + local $ENV{NAMESPACE_CLEAN_USE_PP} = 1 unless $has_d_h; + my @cmd = ( + $^X, + $has_d_h ? '-MDevel::Hide=B::Hooks::EndOfScope' : (), + $fn + ); # this is cheating, and may even hang here and there (testing on windows passed fine) # if it does - will have to fix it somehow (really *REALLY* don't want to pull diff -Nru libnamespace-clean-perl-0.21/xt/author/07-debugger.t libnamespace-clean-perl-0.22/xt/author/07-debugger.t --- libnamespace-clean-perl-0.21/xt/author/07-debugger.t 2011-07-26 14:56:10.000000000 +0000 +++ libnamespace-clean-perl-0.22/xt/author/07-debugger.t 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -use Test::More; - -BEGIN { - plan skip_all => 'Only applicable on perl >= 5.8.9' - if $] <= 5.008008; - -#line 1 -#!/usr/bin/perl -d -#line 10 - - push @DB::typeahead, "c", "q"; - - # try to shut it up at least a little bit - open my $out, ">", \my $out_buf; - $DB::OUT = $out; - open my $in, "<", \my $in_buf; - $DB::IN = $in; -} - -{ - package Foo; - - BEGIN { *baz = sub { 42 } } - sub foo { 22 } - - use namespace::clean; - - sub bar { - ::is(baz(), 42); - ::is(foo(), 22); - } -} - -ok( !Foo->can("foo"), "foo cleaned up" ); -ok( !Foo->can("baz"), "baz cleaned up" ); - -Foo->bar(); - -done_testing;