Reduce is a much better name. It calls your sub with $a and $b set to the first two elements of the array which is neater in some ways, but would make it harder to write the factorial example above.
Here is a related question - I tried to write the subroutine above with the paramters ($&@) but I couldn't then call the subroutine - looks like a bug... (I posted an example of this a bit further up the thread)
BTW it is List::Util
In reply to RE: RE: scalarmap - some new perl syntax
by ncw
in thread scalarmap - some new perl syntax
by ncw
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |