# # This file is auto-generated. ***ANY*** changes here will be lost # package Errno; use vars qw(@EXPORT_OK %EXPORT_TAGS @ISA $VERSION %errno $AUTOLOAD); use Exporter (); use Config; use strict; $Config{'myarchname'} eq "x86_64-linux" or die "Errno architecture (x86_64-linux) does not match executable architecture ($Config{'myarchname'})"; $VERSION = "1.111"; @ISA = qw(Exporter); @EXPORT_OK = qw(); %EXPORT_TAGS = ( POSIX => [qw( )] ); sub TIEHASH { bless [] } sub FETCH { my ($self, $errname) = @_; my $proto = prototype("Errno::$errname"); if (defined($proto) && $proto eq "") { no strict 'refs'; return $! == &$errname; } require Carp; Carp::confess("No errno $errname"); } sub STORE { require Carp; Carp::confess("ERRNO hash is read only!"); } *CLEAR = \&STORE; *DELETE = \&STORE; sub NEXTKEY { my($k,$v); while(($k,$v) = each %Errno::) { my $proto = prototype("Errno::$k"); last if (defined($proto) && $proto eq ""); } $k } sub FIRSTKEY { my $s = scalar keys %Errno::; goto &NEXTKEY; } sub EXISTS { my ($self, $errname) = @_; my $proto = prototype($errname); defined($proto) && $proto eq ""; } tie %!, __PACKAGE__; 1; __END__ =head1 NAME Errno - System errno constants =head1 SYNOPSIS use Errno qw(EINTR EIO :POSIX); =head1 DESCRIPTION C defines and conditionally exports all the error constants defined in your system C include file. It has a single export tag, C<:POSIX>, which will export all POSIX defined error numbers. C also makes C<%!> magic such that each element of C<%!> has a non-zero value only if C<$!> is set to that value, eg use Errno; unless (open(FH, "/fangorn/spouse")) { if ($!{ENOENT}) { warn "Get a wife!\n"; } else { warn "This path is barred: $!"; } } =head1 AUTHOR Graham Barr =head1 COPYRIGHT Copyright (c) 1997-8 Graham Barr. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut