diff --git a/src/lib/Hydra/Helper/AttributeSet.pm b/src/lib/Hydra/Helper/AttributeSet.pm index b750d6e1..21966394 100644 --- a/src/lib/Hydra/Helper/AttributeSet.pm +++ b/src/lib/Hydra/Helper/AttributeSet.pm @@ -50,7 +50,7 @@ sub splitPath { sub enumerate { my ($self) = @_; my @paths = sort { length($a) <=> length($b) } @{$self->{"paths"}}; - return wantarray ? @paths : \@paths; + return @paths; } 1; diff --git a/t/Helper/attributeset.t b/t/Helper/attributeset.t index 273417bf..9c6c7b02 100644 --- a/t/Helper/attributeset.t +++ b/t/Helper/attributeset.t @@ -31,8 +31,9 @@ $attrs->registerValue("foo"); $attrs->registerValue("bar.baz.tux"); $attrs->registerValue("bar.baz.bux.foo.bar.baz"); +my @enumerated = $attrs->enumerate(); is( - \@{$attrs->enumerate()}, + \@enumerated, [ # "foo": skipped since we're registering values, and we # only want to track nested attribute sets.