Associative Array

Hi,
I am trying to make an associative array to use in a popup_menu on a website. Here is what i have:

foreach $entr ( @entries )
{
$temp_uid[$s] = $entr->get_value(uid);
$temp_naam[$entr->get_value(uid)] = $entr->get_value(sn);
$s++;
}

This is the popup_menu i want to use it in.
popup_menu(-name=>'modcon', -values=>\@temp_uid, -labels=>\%temp_naam);

It doesn't work and i cannot find where i am wrong!
hopefully someone can help..

Tine

$temp_uid[$s] = $entr->get_value(uid);
$temp_waarde = $entr->get_value(uid);
$temp_naam{$temp_waarde} = $entr->get_value(sn);

changed the [ to { but it still doesn't work..

Ok, dumb question but what language, shell, system are you using?

Looks 90% like it's Perl. At least these are all valid Perl statements. :smiley:

Without giving me a look at a larger part of your program I can't find out what's wrong.

For example, you said popup_menu() doesn't work, but you didn't give us at a look of the full implementation of the subroutine, and what you are trying to pass to the subroutine.

yes i am using perl..

I found out the problem, before i started filling the array, i declared it like this:
%temp_naam = ();

as soon as i removed this, it did work.

Thank you for your time!

Tine