in reply to Re^2: splitting directly to hash
in thread splitting directly to hash

A common misconception of map is that the left hand side of the map-block (the list that get returned by map) must have the same number of elements as the right hand side. That's not true. Every iteration can return any number of list elements to the left.

Examples:
print map { $_, $_, $_ } (1, 2, 3); #111222333 print map { ($_) x $_ } (1, 2, 3); #122333
In your case all you need to do is to build an even sized list that can be assigned to a hash:
print map { $_, ' ') } (1, 2, 3); #1 2 3
The above is the same as
print map { $_ => ' ' } (1, 2, 3); #1 2 3


holli, /regexed monk/