"Sterin, Ilya" <[EMAIL PROTECTED]> wrote:
> Hmmm. Didn't think about that. That would be a nice way, that way you can
> manipulate it's behaviour depending with how many aliases you provide.
>
> for my $el1, $el2 ( (@foo, @bar) ) {
> print "$el\n"
> }
>
> $el1 and $el2 would of course be aliases, right?
>
I don't think that this special purpose notation is necessary. With the
improved 'want' proposed by Damian, the following should be easy to achieve:
@a = (1,2,3,4);
for ($b,$c) (@a) { print "$b $c"}
# prints:
# 1 2
# 3 4
%d = (a=>1, b=>2);
for ($b,$c) (@a) { print "$b $c"}
# prints:
# a 1
# b 2
Which with the merge() RFC makes the desired behaviour for multiple lists
easy:
@a = (1,2);
@b = (3,4);
for ($b,$c) merge(@a,@b) { print "$b $c"}
# prints:
# 1 3
# 2 4
So, no really new syntax, no special purpose behaviour, just the obvious
extension of for-iterators to list context, and the introduction of one new
function (which happens to have many other applications).