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 344a51e commit d98ea87Copy full SHA for d98ea87
doc/Type/Hash.pod6
@@ -654,7 +654,17 @@ The adverb C<:p> returns a C<Pair> or a List of C<Pair> instead of just the valu
654
The adverbs C<:v> and C<:k> return the key or value or a list their of.
655
656
my %h = a => 1, b => 2;
657
- say %h<a>:k; # a
+ say %h<a>:k; # a
658
say %h<a b>:k; # (a b)
659
660
+You can also use the adverbs without knowning anything about the hash by using
661
+empty angle brackets in which case all the keys and values will be listed:
662
+
663
+ my %h1 = a => 1;
664
+ my %h2 = a => 1, b => 2;
665
+ say %h1<>:k # (a)
666
+ say %h1<>:v # (1)
667
+ say %h2<>:k # (a b)
668
+ say %h2<>:v # (1 2)
669
670
=end pod
0 commit comments