http://www.perlmonks.org?node_id=629702


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

Yet again, it's all about context:

my @lines1 = split(' ', @lines);

split expects a regexp and a string as arguments, which are both scalars. @lines is evaluated in scalar context, returning the number of elements it contains. So, split has nothing to split, and returns the number of elements to be assigned to @lines1.