Multiple choice technology programming languages

Which operator can be used to access the first item in an array?

  1. shift

  2. start

  3. right$
  4. left$
Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Perl's shift() function removes and returns the first element from an array. This is the standard way to access the first item, making option A correct. Functions like start, left$, and right$ don't exist in Perl. unshift adds to the beginning, pop/shift remove from ends, but shift is specifically for the first element.