[Oberon] How to mimic an associative array

Duke Normandin dukeofperl at ml1.net
Thu Dec 2 18:03:07 CET 2010


On Thu, 2 Dec 2010, Stauber  Sven Philipp wrote:

Hello my friend...

> Hi Duke,
>
> I'm somewhat confused because of the term "hashing". I guess what
>  you want is something like:

In Javascript, it would be:

var my_cars= new Array()
my_cars["cool"]="Mustang";
my_cars["family"]="Station Wagon";
my_cars["big"]="SUV";

I'm writing a CGI module to deal with HTML <form> variable/value
pairs. I'm _very_ familiar with the Perl way (since 199?), where the
contents of QUERY_STRING, PATH_INFO, or STDIN are "split" in pairs,
then the pairs split again and stuffed into an associative array
(hash), e.g.

FORM[name]="Duke"
FORM[age]=63
etc

Associative array functionality is built into Perl, so we never had to
deal with the implementation details. I would have though that after
all these years, Oberon would have had a module kicking around that
offered the same functionality. Maybe there is! but I have yet to find
it. maybe the code that you have included in your post, does exactly
that? I haven't studied it yet - but I will!!

Anyway, I'm much obliged for your input.

-- 
Duke



More information about the Oberon mailing list