In Perl, the special variable $? contains the status (return code) of the last external command executed, typically through system(), backticks, or piped opens. It is not for page length, EOL characters, or library error codes. The value is 0 for successful execution and non-zero for errors, following Unix conventions.