>>>>> "Damian" == Damian Conway <[EMAIL PROTECTED]> writes:
>> foreach @bigarray {
>> yield (push @array1, $_);
>> yield (push @array2, $_);
>> yield (push @array3, $_);
>> push @array4, $_;
>> };
Damian> Except that C<yield> is like C<return> and breaks out of the current
Damian> *subroutine*, not the current block.
Damian> Damian
Well, OK then....
foreach @bigarray {
sub {
yield (push @array1, $_);
yield (push @array2, $_);
yield (push @array3, $_);
push @array4, $_;
}->();
};
:-)
Which of course won't work, unless there's a lot more magic going on.
(Which coderef gets the yield state attached to it, and would this properly
be recognized as a reason to clone the coderef?)
--
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!