Paul,
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.
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.
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.
-Bob
--- Paul <[EMAIL PROTECTED]> wrote:
>
> --- 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/
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/