in reply to Re^2: Using map to Add a Line Breaks to a List
in thread Using map to Add a Line Breaks to a List

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.

  • Comment on Re^3: Using map to Add a Line Breaks to a List

Replies are listed 'Best First'.
Re^4: Using map to Add a Line Breaks to a List
by Aristotle (Chancellor) on Mar 05, 2005 at 07:56 UTC

    As will several other solutions. Good catch.

    Makeshifts last the longest.