Step 2: &total
sub total {
my (@numbers) = @_;
my $total = 0;
foreach my $number (@numbers) {
$total += $number;
}
continued...
| CPU: Perl, Fall 2005 | Perl, Week 3: More Arrays, Context, Subroutines, Lexical Variables | #59 |
sub total {
my (@numbers) = @_;
my $total = 0;
foreach my $number (@numbers) {
$total += $number;
}
continued...
| Copyright © 2005 Ian Langworth |