in reply to Using map to split an array to hash key/values
To fill the hash by assigning to it, you need to have a list that consists of key/value pairs - which you were obtainig before via split. You can do the same thing:
Split will break each element of @array into a key/value pair (just like your code does), and map will accumulate them into a list, then you assign the list to the hash.my %hash = map { split /:/; } @array;
Is that what you were after?
|
|---|