Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sub add(@arr) {
- my $sum = 0;
- for @arr -> $e {
- $sum += $e;
- }
- $sum;
- }
- my @arr = (1, 2, 3, 4, 5);
- my $sum = add(@arr);
- $sum == 15 or die "Wrong value";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement