Skip to content

Commit a5dee80

Browse files
Dan Zwellugly-ec2-automated
authored andcommitted
Document Hash's :kv adverb
Also fix a small grammar error.
1 parent 4ec20e2 commit a5dee80

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

doc/Type/Hash.pod6

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,12 +674,17 @@ The adverb C<:p> returns a C<Pair> or a List of C<Pair> instead of just the valu
674674
675675
=head2 C<:v> and C<:k>
676676
677-
The adverbs C<:v> and C<:k> return the key or value or a list their of.
677+
The adverbs C<:v> and C<:k> return the key or value or a list thereof.
678678
679679
my %h = a => 1, b => 2;
680680
say %h<a>:k; # OUTPUT: «a␤»
681681
say %h<a b>:k; # OUTPUT: «(a b)␤»
682682
683+
The adverb C<:kv> returns a list of keys and values.
684+
685+
my %h = a => 1, b => 2, c => 3;
686+
say %h<a c>:kv; # OUTPUT: «(a 1 c 3)␤»
687+
683688
You can also use the adverbs without knowing anything about the hash by using
684689
empty angle brackets in which case all the keys and values will be listed:
685690

0 commit comments

Comments
 (0)