Hi Jerry
I'm not sure, but maybe this is what you mean:

my @IDS = qw (a b c d e f g);
my $c=0;
foreach my $id (@IDS){
        $c++;
        $id.=$c;
        print "$id\n";
}

# Hans

On Sunday, June 8, 2003, at 09:41 PM, Jerry Preston wrote:

Hi!

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?

Thanks,

Jerry



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



Reply via email to