Multiple choice technology programming languages

What will be output ? my $val = 'x'; print ref($val);

  1. STRING

  2. SCALAR

  3. Empty Value

  4. Not a Reference

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

In Perl, the ref function returns an empty string when the variable passed to it is not a reference. Since $val is a plain string scalar, ref($val) evaluates to an empty string ('Empty Value', 596740) rather than throwing an error or returning a label like SCALAR.