POSIX::1003::Errno - all error codes defined by the OS
use POSIX::1003::Errno; # load all names use POSIX::1003::Errno qw(errno); # keys are strings! $ticks = errno('EPERM'); use POSIX::1003::Errno qw(errno EPERM); if($!==EPERM) ... use POSIX::1003::Errno '%errno'; my $key = $errno{EPERM}; $errno{EUNKNOWN} = 1024; $ticks = errno('EUNKNOWN'); print "$_\n" for keys %errno;
The error codes provided by your operating system.
The code modules Errno and POSIX do also contain an extensive list of error numbers. However: Errno have their values hard-coded, which is incorrect (higher numbered codes may [do!] differ per platform). POSIX only provides a limited subset.
Returns the string representations of the $errno, as provided by the operating system.
Returns the errno value related to the NAMEd constant. The $name must be a string. undef will be returned when the $name is not known by the system.
undef
example:
my $ticks = errno('EPERM') || 1000;
Returns a list with all known names, unsorted.
This exported variable is a tied HASH which maps E* names on numbers, to be used with the system's errno() function.
E*
errno()
The following error names where detected on your system when the module got installed. The second column shows the related value. Followed by the text that strerror() produces for that error. Or course, your error messages may be translated.
During installation, a symbol table will get inserted here.
This module is part of POSIX-1003 distribution version 1.02, built on November 10, 2020. Website: http://perl.overmeer.net/CPAN. The code is based on POSIX, which is released with Perl itself. See also POSIX::Util for additional functionality.
Copyrights 2011-2020 on the perl code and the related documentation by [Mark Overmeer]. For other contributors see ChangeLog.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://dev.perl.org/licenses/
To install POSIX::1003, copy and paste the appropriate command in to your terminal.
cpanm
cpanm POSIX::1003
CPAN shell
perl -MCPAN -e shell install POSIX::1003
For more information on module installation, please visit the detailed CPAN module installation guide.