--- Bob Mangold <[EMAIL PROTECTED]> wrote:
> Within the loop, some other programs are executed and occasionally it
> may take a few minutes to complete everything and then continue. So
> I'm just throwing a little counter to STDOUT so I can monitor the
> progress, to ensure it doesn't get hung up somewhere.

lol -- ok. I was wondering.
I saw lot's of suggestions, but wondered if any of them really helped
you. From the look of it, I'd say the method you're using is about as
good as any.

> I knew of all the different ways to do it, but since my programs tend
> to deal a lot with arrays and looping through them I run into this
> issue (of how to count through them) all the time. I was just curious
> if there was another way.

Lots, but probably none much better.
For this, I probably would use "....} continue { $count++ }"
but only to isolate this metadata from actual programatic logic.

> It seems to me that since Perl has the ability to know things like
> where a search left off, or what the last matched item was, or what
> line of a file it's reading, that it might be keeping track of this
> too.

Makes sense.
 
> > --- Bob Mangold <[EMAIL PROTECTED]> wrote:
> > > Is there a perl variable that automatically counts loop
> > > iterations. Such that I don't have to use '$count':
> > > 
> > > foreach (@array){
> > >   $count++;
> > >   ..whatever..
> > > }
> > 
> > Lot's of people with suggestions, but I have a question --
> > what are you using $count for? Why do you need it?


__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

Reply via email to