Multiple choice technology programming languages

my $val = ‘x’; print ref($val);

  1. scalar

  2. any decimal value

  3. empty value

  4. x

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

The ref() function returns the type of a reference (HASH, ARRAY, etc.). For a plain scalar like 'x' (which is not a reference), ref() returns an empty string (false value). It doesn't return 'scalar' - that's a data type, not a reference type.