in reply to Rook question
Try this:
sub total{ my $sum = shift(@_); foreach (@_){ $sum += $_; } return $sum; }
- add $_, not @_
- return $sum
- Add trailing } to match braces
"By three methods we may learn wisdom: First, by reflection, which is noblest; Second, by imitation, which is easiest; and third by experience, which is the bitterest." -Confucius
In Section
Seekers of Perl Wisdom