We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2fcee5a commit addc11fCopy full SHA for addc11f
lib/PPI/Normal.pm
@@ -86,7 +86,7 @@ sub register {
86
}
87
88
# Has it already been added?
89
- if ( List::Util::any { $_ eq $function } ) {
+ if ( List::Util::any { $_ eq $function } map @{$_}, values %LAYER ) {
90
return 1;
91
92
t/09_normal.t
@@ -58,6 +58,5 @@ NO_DOUBLE_REG: {
58
is $PPI::Normal::LAYER{2}[-1], "main::just_a_test_sub", "and find subs at right layer";
59
my $size = @{ $PPI::Normal::LAYER{2} };
60
ok( PPI::Normal->register( "main::just_a_test_sub", 2 ), "can add subs again" );
61
- local $TODO = 'prevent duplicate registrations of normals';
62
is scalar @{ $PPI::Normal::LAYER{2} }, $size, "but sub isn't added twice";
63
0 commit comments