On Fri, Sep 27, 2002 at 01:40:09PM -0700, John W. Krahn wrote:

> [EMAIL PROTECTED] wrote:
> > When using foreach or while() on an array, how can I access the index of
> > the list that foreach()/while() is working upon? Is there an internal
> > variable that stores this info like PHP's current()?
> 
> No, Perl doesn't have a variable like that, you have to create your own.

And the primary reason it doesn't is performance.  Why pay the price of
keeping this variable updated when you don't need it most of the time?
And when it is not that onerous to roll your own.

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to