> Hi!
Howdy
>
> I am not sure if this can be done or not, but I want to
> create a counter on the fly so to speak.
>
> foreach $id ( @IDS ) {
> $cnt = "$id"."_cnt";
> $cnt++;
> }
>
> All I get is "item_cnt". Is there a way to do this?
You assigning a string to $cnt then adding 1 to it, that doesn't make sense
If all you want is a count of items in an array:
my $cnt = $#IDS + 1;
Or you want to count how many get processed:
my $cnt;
for(@IDS) {
print "$cnt - $_ \n";
$cnt++;
}
HTH
DMuey
>
> Thanks,
>
> Jerry
>
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]