It's due to the capturing regex in list context. This returns a list of captured strings. Map then passes this list and the "\n" to print. Since $, = $\ = "", your output works the way it does. Of course, this will print blank lines if your filename doesn't contain a period.
In reply to Re^3: Using map to Add a Line Breaks to a List
by !1
in thread Using map to Add a Line Breaks to a List
by goober99
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |