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.