Multiple choice technology programming languages

How to check if key exists in a hash or not ?

  1. exists

  2. defined

  3. undef

  4. exist

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

The exists function checks if a specific key exists in a hash, returning true/false. This is different from defined, which checks if a value is defined (a key can exist but have undef value). undef is a function/value, and exist is not a valid Perl function name.