In Perl, the special variable $! contains the current value of errno (the error code from a system library routine) when a system call fails. It provides both numeric error code in numeric context and descriptive error string in string context. It is not for page length, EOL characters, or command return codes (which is $?).