Multiple choice

Pick the wrong piece of code regarding the transformation of text into array.

  1. \$str = "PERL is one of the popular programing languages"; @words = split(' ', \$str);
  2. \$str = "PERL is one of the popular programing languages"; @words = split('', \$str);
  3. \$str = "PERL is one of the popular programing languages"; @words = split(' ', \$str, 3);
  4. Option 1 and Option 3 are correct

  5. All 3 codes are correct and gives different results

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

Yes, All are different and valid codes.