Multiple choice technology programming languages

What do the variable $! contains?

  1. Page length of a particular output file

  2. The input end-of-line character

  3. The return code returned by a command called by the system function.

  4. The error code generated by a system library routine.

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

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 $?).