Multiple choice technology programming languages

What value do variables have before they are first assigned?

  1. undef

  2. null

  3. 0

  4. nil

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

In Perl, variables have the special value undef before their first assignment. This is different from null in other languages - undef means undefined or uninitialized. Variables are not automatically set to 0 or any other default value.