my @output = map s/(.*)/ $1\n/, @small_files;
The substitution operator s returns the number of captured substrings, which is 1. It also alters the string it is bound to ($_ by default, as you are aware), but this alteration is by side-effect. Check the contents of @small_files immediately after this statement.
What you want is
my @output = map " $_\n", @small_files;
Updated: I am taking the liberty of deleting the false part of my original answer (which is accurately quoted and accurately corrected in kyle's reply below). Thanks, kyle. What was I thinking?
In reply to Re: Newbie: parentheses, map, etc.
by Narveson
in thread Newbie: parentheses, map, etc.
by nefigah
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |