Advertisement
Guest User

Untitled

a guest
Aug 6th, 2016
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. #!usr/bin/perl6
  2.  
  3. my %hash, my $last, my $start = now;
  4. for $*IN.words -> $word {
  5. { %hash{$word}++; } if %hash{$word}:exists;
  6. { %hash{$word}++; } unless %hash{$word}:exists;
  7. $last = $word;
  8. }
  9. say "last number: $last, amount of times: %hash{$last}, exec time: {now - $start}";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement