I have the following data structure:
@keys = [1, 2, 3, 4];
And using a loop (for) from 1 to 4, I want to create a new data structure like
$new = +{ key => '1',
meaning => '',
time => '', };
So, basically I would have in this case four $new data structures.
Do I need to use the map function?
maporforeachalthoughmapis more common/idiomatic.@keys = [1, 2, 3, 4]does not assign an array, it assigns an array of arrays (well, the first element of the array is an array).