Skip to content

Commit fd6293b

Browse files
committed
Merge pull request #328 from gfldex/master
fix :exists example | add :delete to Hash
2 parents 42d74b4 + 409f9ed commit fd6293b

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

doc/Type/Hash.pod

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,17 @@ Some methods are implemented as adverbs on subscripts.
263263
The adverb C<:exists> returns C<Bool::True> if a key exists in the Hash. If more then one key is supplied it returns a C<List> of C<Bool>.
264264
265265
my %h = a => 1, b => 2;
266-
say %h<a>; # True
267-
say %h<a b>; # (True True)
266+
say %h<a>:exists; # True
267+
say %h<a b>:exists; # (True True)
268+
269+
=head2 C<:delete>
270+
271+
Use C<:delete> to remove a C<Pair> from the C<Hash>.
272+
273+
my %h = a => 1;
274+
dd %h; # Hash %h = {:a(1)}
275+
%h<a>:delete;
276+
dd %h # Hash %h = {}
268277
269278
=head2 C<:p>
270279

0 commit comments

Comments
 (0)