File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff 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
674
674
675
675
= head2 C < :v > and C < :k >
676
676
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 .
678
678
679
679
my %h = a => 1, b => 2;
680
680
say %h<a>:k; # OUTPUT: «a»
681
681
say %h<a b>:k; # OUTPUT: «(a b)»
682
682
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
+
683
688
You can also use the adverbs without knowing anything about the hash by using
684
689
empty angle brackets in which case all the keys and values will be listed:
685
690
You can’t perform that action at this time.
0 commit comments