Multiple choice technology programming languages

@array = (1,2,3); $scalar = $array[3]; print “$scalar”;

  1. 3

  2. 0

  3. Error:Array value out of bound

  4. Null value

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

Perl arrays are 0-indexed. @array = (1,2,3) has indices 0,1,2. Accessing $array[3] is out of bounds. Unlike many languages, Perl returns undef (undefined value) rather than throwing an error. undef prints as empty string, which appears as null/empty. Option D correctly identifies this as null value.