If you really, really want a built in method, then you could always write a C function and call that...
#! /usr/bin/perl -w use strict; use Inline C => <<'ADDUP_END'; double addup( SV* stub, ... ) { double total = 0; int i; Inline_Stack_Vars; for( i = 0; i < Inline_Stack_Items; ++i ) { total += SvNV(Inline_Stack_Item(i)); } return total; } ADDUP_END my @a = (0..100); print addup(@a), "\n";
But is it worth the effort?
--In reply to Re: addup function? => use Inline!
by grinder
in thread addup function?
by tomazos
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |