Advertisement
Guest User

Untitled

a guest
Dec 12th, 2016
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 6 0.37 KB | None | 0 0
  1. #!/usr/bin/env perl6
  2. use v6;
  3.  
  4. my $key = 'foo';
  5. my %hash;
  6. %hash.append($key, 'bar');
  7. %hash.append($key, 'baz');
  8.  
  9. dd %hash;
  10.  
  11. say "\nBraces with string:";
  12. dd %hash{'foo'};
  13.  
  14. say "\nChevrons, 1 word:";
  15. dd %hash<foo>;
  16.  
  17. say "\nBraces with var:";
  18. dd %hash{$key};
  19.  
  20. say "\nGuillemets, 1 var:";
  21. dd %hash«$key»;
  22.  
  23. say "\nBraces with var + comma:";
  24. dd %hash{$key,};
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement