Thread
:
Perl ? - sum all values of array
View Single Post
09-16-2005, 04:28 PM
#
2
(
permalink
)
sarg
Junior Member
Join Date: Jul 2005
Posts: 14
Give this a try:
PHP Code:
my
@array = (
1
..
10
);
my $total
=
0
;
(
$total
+=
$_
) for @array;
print
$total
;
hope it helps
sarg
View Public Profile
Send a private message to sarg
Find More Posts by sarg
Sponsored Links