in reply to Re^5: the annoying keys "key" and "value"
in thread the annoying keys "key" and "value"
Say you want an associative array.
With a hash, a lookup would look like
my $val = $hash{$key};
With the OP's structure, a lookup would look like
my ($val) = map $_->{value}, grep $_->{key} eq $key, @$data;
That makes it a "pathological" structure to use as an associative array. However, it's an appropriate structure to store ordered key-value pairs.
|
|---|