Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^3: reduce like iteratorsby ikegami (Patriarch) |
on Jan 03, 2011 at 19:54 UTC ( [id://880252]=note: print w/replies, xml ) | Need Help?? |
Your reduce_list is named similarly to reduce, but bears no resemblance since it doesn't to reduce at all.
Because of those reasons, reduce is a general purpose function. (It can implement any other function in List::Util.) Your reduce_list is just grep with access to the last element. This accounts for the differences with what I suggested it should look like.
In Section
Seekers of Perl Wisdom
|
|