I tried using a for loop but I don't think that worked either.#! usr/bin/perl @nums = (1,2,3,4); $s = shift@nums; \\ I know that gives $s 1 $p = pop@nums; \\ This gives $p 4 $sum += $_ for @nums; print "$sum";
In reply to using pop and shift to find the sum of an array by perlguru22
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |