I can't remember if there's a shortcut for adding all elements of an array in Perl.. it sounds like the kind of thing that Perl would be able to do, so I thought I'd ask. The quickest way I know is something like this:
my $total_size = 0;
foreach $item (@array) {
$total_size += $item;
}
Is there a quicker way? Thanks.. Liam Morley
lmorley@wpi.edu
"light the deep, and bring silence to the world.
light the world, and bring depth to the silence."
my $total_size = 0;
foreach $item (@array) {
$total_size += $item;
}
Is there a quicker way? Thanks.. Liam Morley
lmorley@wpi.edu
"light the deep, and bring silence to the world.
light the world, and bring depth to the silence."