8 lines
136 B
Perl
8 lines
136 B
Perl
|
@array = (1, 2, 3);
|
||
|
$running_sum = 0;
|
||
|
|
||
|
foreach $element (@array) {
|
||
|
$running_sum += $element;
|
||
|
}
|
||
|
|
||
|
print "Total = $running_sum";
|