in reply to Split on new line
When you slurp all lines of your file into @file, each element of the array should contain one line ending in a newline character. You can prove this by printing the contents of the array as follows:
use Data::Dumper; print Dumper(\@file);
If you then want to remove the newline characters, use chomp:
chomp @file;
|
|---|