No, I don't think you are understanding it correctly.  It's not about
looping sequentially, but rather simultaneouly, for comparison purposes.

@foo = (1,2,3);
@bar = (1,2,3);
for my ($foo, $bar) (@foo, @bar)  #As the index for @foo increases, so 
                                  #does @bar index
{
print "OK\n" if $foo == $bar;
}

Will print...
OK
OK
OK

Ilya

-----Original Message-----
From: Eric Roode
To: [EMAIL PROTECTED]
Sent: 07/20/2001 11:30 AM
Subject: Re: array/hash manipulation [was :what's with 'with'?]

on Fri Jul 20, Mark REED wrote:
>I'm sorry, but I fail to see how this is a big improvement over the
>current version:
>
>    while (my ($key, $val) = each %my_hash)
>    { ... }

And a workalike to

     while ( ($a,$b,$c) = (@a, @b, @c) )
or
     for my ($el1, $el2)  (@foo, @bar)
     
is very easy to code in perl 5. At the risk of sounding reactionary,
this doesn't seem like a Big Win for perl.

 ----------------------------------------------------------------------
 Eric J. Roode                                            [EMAIL PROTECTED]
 Senior Software Engineer, Myxa Corporation

Reply via email to