in reply to Re^2: map split vs array split
in thread map split vs array split

Note that chomp can act on an array so you can:

use strict; use warnings; my $file1 = <<FILE; apple goat chocolate newyork FILE open IN, '<', \$file1; my @lines = <IN>; close IN; chomp @lines; print "@lines1\n";

Prints:

apple goat chocolate newyork

DWIM is Perl's answer to Gödel