On Wed, Aug 08, 2001 at 10:46:29AM -0500, Mooney Christophe-CMOONEY1 wrote:
> I need to read elements from @blah from "left-to-right" (ie. in the
> order that successive shifts would read them). I seem to remember
> reading somewhere that one should use 'for' only when s/he doesn't
> care about the order in which the elements are chosen. However, every
> time i try 'for (@blah)', it reads "left-to-right".
>
> In other words, is
> for (@blah)
> {
> whatever($_);
> }
> effectively equivalent to
> for ($i=0;$i<@blah;$i++)
> {
> whatever($blah[$i]);
> }
> ?
Yes.
Ordering within hashes is undefined. You will encounter this using
"keys", "values" and "each".
--
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]