in reply to Re: •Re: Comparing and Counting Arrays Length
in thread Comparing and Counting Arrays Length

If you do:
@array1 = "foo bar baz";

Then you have just one thing on the right hand side. Hence, you only get one thing on the left hand side, so @array1 contains just one element.

The split function, as documented in the manual page, takes a regex and a string as argument, and splits the string in several parts, based on the regex. An argument of " " is special, and splits the string on whitespace. Splitting "foo bar baz" on whitespace gives you a list of three strings, hence the array will contain three elements.

Abigail