Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- my $n = (1..10)
- .grep({ $_ mod 2 != 0 })
- .map({ $_ ** 2 })
- .reduce: { $^a + $^b };
- $n == 1 ** 2 + 3 ** 2 + 5 ** 2 + 7 ** 2 + 9 ** 2 or die "Wrong value";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement