daily pastebin goal
58%
SHARE
TWEET

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

cwchen Oct 28th, 2017 92 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
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top