in reply to Re^2: from array to hash with grep
in thread from array to hash with grep

It's still possible but you'll have to use something closer to what sonofason wrote. For each match, you need to create a ($key, $value) pair so the list constructed by map is more like ($key1, $value1, $key2, $value2, $key2, $value3) for the three values. That way, assigning to the hash will insert them as you want.

Now the code you can use to do that, can read for example:

@flat = map { /\w{3}_(\w)/ ? ($1, $_) : () } @inp;
It'll create a pair like ("A", "abc_A_bla") for a match, and an empty list for no match.

Assign to the hash, and you get:

%inp = map { /\w{3}_(\w)/ ? ($1, $_) : () } @inp;