daily pastebin goal
64%
SHARE
TWEET

[Perl 6] Deleting key/value pairs from a hash.

cwchen Oct 28th, 2017 85 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. my %hash = one => "eins", two => "zwei", three => "drei";
  2.  
  3. %hash.keys.elems == 3 or die "Wrong count";
  4.  
  5. # Delete one key-value pair.
  6. %hash<three>:delete;
  7.  
  8. %hash.keys.elems == 2 or die "Wrong count";
RAW Paste Data
Top