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
In reply to Re^3: map split vs array split
by GrandFather
in thread map split vs array split
by convenientstore
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |