in reply to Golf: Adding up array elements
Besides brevity, it might also execute faster since Util.xs informs us that sum() is coded in C, as NV sum(...)
use List::Util qw(sum); print sum (my @arr = qw( 1 3 5 6));
|
---|
In Section
Seekers of Perl Wisdom