On 2019-12-06 16:15, ToddAndMargo via perl6-users wrote:
Checking for the presence of a key/value:
my %h = a => "x", b=>"r", c=>"z";
if %h<c> { say "exists"; } else { say "DOES NOT exist"; }
DOES NOT exist
if %h<b> { say "exists"; } else { say "DOES NOT exist"; }
exists
Oooops! Mark caught a typo. `%h<c>` should have been ` %h<d>`
Corrected code:
Checking for the presence of a key/value:
my %h = a => "x", b=>"r", c=>"z";
if %h<d> { say "exists"; } else { say "DOES NOT exist"; }
DOES NOT exist
if %h<b> { say "exists"; } else { say "DOES NOT exist"; }
exists
Thank you Mark!
-T