> >"Dennis Stout" wrote ... > > my %user_list = get_users($where); > > > > foreach (keys %user_list) { > > my $user = $_; > > foreach (@{$user_list{$user}{DOMAIN}}) { > > $user_list{$user}{DOMAINS} .= > >"$user_list{$user}{DOMAIN}[$_],"; > > } > > chop($user_list{$user}{DOMAINS}); > >... > > >$user_list{$user}{DOMAINS} .= "$user_list{$user}{DOMAIN}[$_],"; > > That line is the culprit. $_ contains each domain name as a text > string. Which evaluates to 0 when used as an integer, which then gives the > first entry in the array. Thus you get the first entry in the array as > many times as you have entries in the array. Try changing that to a > regular (indexed) for loop and that should fix it.
Good eye, I was too busy thinking of hashes and things.
I hate array's.
Should just be $user_list{$user}{DOMAINS} .= "$_,"; huh?
Yep. After I sent the last email I realized that suggesting an indexed for loop
was more effort than just deleting part of the string already there, like you just
suggested.
Thanks
No problem.
-Andrew
Dennis