UPDATE: Thank you all for your suggestions! I'm all set!memnoch
Venerated Monks,
I'm wondering if there is a clever way to assign unique values to a simple array without having to loop through the array for each value to be considered. In my situation, there is no way to tell the array position that the possible value might beforehand, so I can't use an index.
As an alternative, I have tried using a hash instead, like so:
my $test;
unless (exists($hash{$test})) {
$hash{$test} = "dummy"; # Don't care about the value
}
That way, I get unique values. But when I try to retrieve the values with:
keys(%hash)
I'm not guaranteed to get them in the order that I inserted them. The inserted order is preferred but not essential. Any ideas?
Thank you,
memnoch