You inserted a comma behind
chomp - so each iteration of map returns a list, consisting of the return value of
chomp and then the value of
$_. If you substitute a semicolon for the comma it will work fine. But you can do that without
map:
open I, "find $dir| "; chomp (my @file = <I>);
See
perldoc -f chomp.
Makeshifts last the longest.