This particular usage of split removes all whitespace, not split in general. If you split on something more specific such as a space or a tab then the newline will still be found in the last element of the list.
use Data::Dumper;
while (<DATA>) {
my @foo = split;
my @bar = split / /, $_;
print Dumper \@foo, \@bar;
}
__DATA__
hello world
foo bar baz