> foreach @bigarray {
> sub {
> yield (push @array1, $_);
> yield (push @array2, $_);
> yield (push @array3, $_);
> push @array4, $_;
> }->();
> };
>
> :-)
As I've said before, Randal, you're a bad, bad man.
Of co
> "Damian" == Damian Conway <[EMAIL PROTECTED]> writes:
>> foreach @bigarray {
>> yield (push @array1, $_);
>> yield (push @array2, $_);
>> yield (push @array3, $_);
>> push @array4, $_;
>> };
Damian> Except that C is like C and breaks out of the current
Damian> *subroutine*, not the current
>foreach @bigarray {
>yield (push @array1, $_);
>yield (push @array2, $_);
>yield (push @array3, $_);
>push @array4, $_;
>};
Except that C is like C and breaks out of the current
*subroutine*, not the current block.
Damian
Damian Conway wrote:
>
> What you want is:
>
> %newhash = map {yield $_; transform($_)} %oldhash;
>
> This flattens the %oldhash to a sequence of key/value pairs. Then the
> first time the map block is called (i.e. on a key) it immediately
> returns the key. The second time, it resumes
> Have you considered adding a C example to RFC 31? Yield would add
> multiple output items per input item better IMO than the current practice
> of accumulating a list of output items and returning it at the end.
>
>%newhash = map {yield $_; transform $somehash{$_}} @keysubse
Damian Conway wrote:
> :-)
>
> I did consider that too, but the problem is that according to RFC 31 a
> C leaves the future entry point of a block at the next statement
> after the C, whereas the block needs to start from the beginning on
> each iteration.
>
> Damian
Have you considered addin