in reply to I don't get map. How would I use map here?

The first can be written, my %byFile = map { reverse split } <DATA>; That relies on the data being reliable in format.

The second can be mapped, too, but I'd more likely write it either the way you have it, or else as while (my ($key, $val) = each %byFile) { . . .  }. Here is a mapped version, print map {"$_\t=>$byFile{$_}\n"} keys %byFile; I'd favor the "while each" version because it is more sparing of memory, and the results are not likely needed elsewhere.

After Compline,
Zaxo