Multiple choice technology programming languages

What elements will the @a array consist of? $_ = ' a b c '; my @a = split();

  1. ', 'a', ' ', 'b', ' ', 'c', ' '

  2. ', 'a', 'b', 'c', ''

  3. undef, 'a', 'b', 'c', undef

  4. 'a', 'b', 'c'

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

The split() function with no arguments splits the default variable $_ on whitespace. Whitespace includes spaces, tabs, and newlines, and leading/trailing whitespace is ignored. The string ' a b c ' splits into three non-whitespace elements: 'a', 'b', and 'c'.