Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^3: Using map to Add a Line Breaks to a Listby !1 (Hermit) |
on Mar 05, 2005 at 06:17 UTC ( [id://436863]=note: print w/replies, xml ) | Need Help?? |
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 Section
Seekers of Perl Wisdom
|
|