>>>>> "Chaim" == Chaim Frenkel <[EMAIL PROTECTED]> writes:
DC> For example, to short-circuit if the reduction ever becomes undef:
DC> $sum = { defined $_[0] or last; $_[0]+$_[1] } 0, @numbers;
Chaim> Actually, it would be easier to do in reduce, the undefs should
Chaim> simply be ignored.
If I understand you correctly, I want to disagree with you.
What if the "reduce" was to count the number of undefs?
$count = reduce { $a + not defined $b } 0, @some_list;
Do not discard undef from the source list.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!