1. Perl
  2. Module
  3. here

Errno - Constant representing system error number

You can use the Errno module to import constants that represent system error numbers.

use Errno qw/EAGAIN EINTR ECONNRESET EWOULDBLOCK/;

Please refer to here for the types of constants that can be imported.

You can find out what kind of error occurred by numerically comparing the system call error with the predefined variable $! To which it is assigned.

# Call some system call
# ...

# Compare error numbers
if ($! == EAGAIN) {

}

Please note that $! Is a predefined variable and is evaluated as an error number when a numerical comparison is performed, and as an error content when used as a string.

Related Informatrion