aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-10-04 10:43:30 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-10-04 10:43:30 +1300
commitac935907b4ac2e7e1e70a4a85d2b112df59a15c1 (patch)
tree17e48bede2dc397475c232cdbedb5d53ce389ab3
parentRename module to List::Breakdown (diff)
downloadList-Breakdown-ac935907b4ac2e7e1e70a4a85d2b112df59a15c1.tar.gz (sig)
List-Breakdown-ac935907b4ac2e7e1e70a4a85d2b112df59a15c1.zip
Add a description of the synopsis' return valuev0.07
-rw-r--r--lib/List/Breakdown.pm18
-rw-r--r--t/errors.t2
-rw-r--r--t/words.t2
3 files changed, 18 insertions, 4 deletions
diff --git a/lib/List/Breakdown.pm b/lib/List/Breakdown.pm
index 44efc58..c618c76 100644
--- a/lib/List/Breakdown.pm
+++ b/lib/List/Breakdown.pm
@@ -16,7 +16,7 @@ use base qw(Exporter);
our @EXPORT_OK = 'breakdown';
# Specify package version
-our $VERSION = 0.06;
+our $VERSION = 0.07;
# Dispatch table of functions to handle different ref types for the spec
# hashref's values
@@ -89,7 +89,7 @@ List::Breakdown - Build list sublists matching conditions
=head1 VERSION
-Version 0.06
+Version 0.07
=head1 DESCRIPTION
@@ -120,6 +120,20 @@ You could maybe think of this as a multi-C<grep> that returns named results.
};
my %filtered = breakdown $cats, @words;
+This puts the following structure in C<%filtered>:
+
+ (
+ all => ['foo', 'bar', 'baz', 'quux', 'wibble', 'florb'],
+ has_b => ['bar', 'baz', 'wibble', 'florb'],
+ has_w => ['wibble'],
+ length => {
+ 3 => ['foo', 'bar', 'baz'],
+ 4 => ['quux'],
+ long => ['wibble', 'florb'],
+ },
+ has_ba => ['bar', 'baz'],
+ )
+
=head1 SUBROUTINES/METHODS
=head2 B<breakdown(\%spec, @items)>
diff --git a/t/errors.t b/t/errors.t
index 809b0b3..1826087 100644
--- a/t/errors.t
+++ b/t/errors.t
@@ -8,7 +8,7 @@ use Test::More tests => 4;
use List::Breakdown 'breakdown';
-our $VERSION = 0.06;
+our $VERSION = 0.07;
my @t = 1 .. 3;
is( eval { breakdown { a => undef }, @t } || undef, undef, 'error_notref_undef' );
diff --git a/t/words.t b/t/words.t
index 609e2ff..0bbc8cb 100644
--- a/t/words.t
+++ b/t/words.t
@@ -8,7 +8,7 @@ use Test::More tests => 1;
use List::Breakdown 'breakdown';
-our $VERSION = 0.06;
+our $VERSION = 0.07;
my @words = qw(foo bar baz quux wibble florb);
my $filters = {