Subject: | New import function breaks explicitely imported find_cycle find_weakened_cycle |
Hello
Devel::Cycle 1.05 breaks Test::Memory::Cycle.
Test::Memory::Cycle explicitely imports find_cycle and
find_weakened_cycle. These 2 methods are now exported via @EXPORT.
When loading Devel::Cycle, they are also passed to export_to_level, and
are then no longer exported to Test::Memory::Cycle (though I don't know
why).
Anyway, here's a patch that fixes Devel::Cycle behavior. The trick is
to avoid calling export_to_level on methods declared in @EXPORT.
Cheers
--- Devel-Cycle-1.05/lib/Devel/Cycle.pm 2006-05-18 20:17:27.000000000 +0200
+++ Devel-Cycle-1.05.new/lib/Devel/Cycle.pm 2006-05-22
16:17:18.000000000 +0200
@@ -35,12 +35,15 @@
my $self = shift;
my @args = @_;
my %args = map {$_=>1} @args;
- $QUIET++ if exists $args{-quiet};
- $FORMATTING = 'roasted' if exists $args{-roasted};
- $FORMATTING = 'raw' if exists $args{-raw};
- $FORMATTING = 'cooked' if exists $args{-cooked};
- warn join ' ',grep {!exists $import_args{$_}} @_;
- $self->export_to_level(1,grep {!exists $import_args{$_}} @_);
+ $QUIET++ if delete $args{-quiet};
+ $FORMATTING = 'roasted' if delete $args{-roasted};
+ $FORMATTING = 'raw' if delete $args{-raw};
+ $FORMATTING = 'cooked' if delete $args{-cooked};
+
+ my %already_exported = map {$_=>1} @EXPORT;
+ my @export_above = grep {!exists $already_exported{$_} } keys %args ;
+ warn join ' ', @export_above if @export_above ;
+ $self->export_to_level(1, @export_above);
}
sub find_weakened_cycle {