2 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns=
"http://www.w3.org/1999/xhtml">
5 <title>Errno - System errno constants
</title>
6 <meta http-equiv=
"content-type" content=
"text/html; charset=utf-8" />
7 <link rev=
"made" href=
"mailto:" />
10 <body style=
"background-color: white">
11 <table border=
"0" width=
"100%" cellspacing=
"0" cellpadding=
"3">
12 <tr><td class=
"block" style=
"background-color: #cccccc" valign=
"middle">
13 <big><strong><span class=
"block"> Errno - System errno constants
</span></strong></big>
17 <p><a name=
"__index__"></a></p>
22 <li><a href=
"#name">NAME
</a></li>
23 <li><a href=
"#synopsis">SYNOPSIS
</a></li>
24 <li><a href=
"#description">DESCRIPTION
</a></li>
25 <li><a href=
"#caveats">CAVEATS
</a></li>
26 <li><a href=
"#author">AUTHOR
</a></li>
27 <li><a href=
"#copyright">COPYRIGHT
</a></li>
34 <h1><a name=
"name">NAME
</a></h1>
35 <p>Errno - System errno constants
</p>
39 <h1><a name=
"synopsis">SYNOPSIS
</a></h1>
41 use Errno qw(EINTR EIO :POSIX);
</pre>
45 <h1><a name=
"description">DESCRIPTION
</a></h1>
46 <p><code>Errno
</code> defines and conditionally exports all the error constants
47 defined in your system
<code>errno.h
</code> include file. It has a single export
48 tag,
<code>:POSIX
</code>, which will export all POSIX defined error numbers.
</p>
49 <p><code>Errno
</code> also makes
<a href=
"file://C|\msysgit\mingw\html/pod/perlvar.html#item___"><code>%!
</code></a> magic such that each element of
<a href=
"file://C|\msysgit\mingw\html/pod/perlvar.html#item___"><code>%!
</code></a> has a
50 non-zero value only if
<a href=
"file://C|\msysgit\mingw\html/pod/perlvar.html#item___"><code>$!
</code></a> is set to that value. For example:
</p>
54 unless (open(FH,
"/fangorn/spouse
")) {
56 warn
"Get a wife!\n
";
58 warn
"This path is barred: $!
";
61 <p>If a specified constant
<code>EFOO
</code> does not exist on the system,
<code>$!{EFOO}
</code>
62 returns
<code>""</code>. You may use
<code>exists $!{EFOO}
</code> to check whether the
63 constant is available on the system.
</p>
67 <h1><a name=
"caveats">CAVEATS
</a></h1>
68 <p>Importing a particular constant may not be very portable, because the
69 import will fail on platforms that do not have that constant. A more
70 portable way to set
<a href=
"file://C|\msysgit\mingw\html/pod/perlvar.html#item___"><code>$!
</code></a> to a valid value is to use:
</p>
72 if (exists
&Errno::EFOO) {
73 $! =
&Errno::EFOO;
78 <h1><a name=
"author">AUTHOR
</a></h1>
79 <p>Graham Barr
<<a href=
"mailto:gbarr@pobox.com">gbarr@pobox.com
</a>></p>
83 <h1><a name=
"copyright">COPYRIGHT
</a></h1>
84 <p>Copyright (c)
1997-
8 Graham Barr. All rights reserved.
85 This program is free software; you can redistribute it and/or modify it
86 under the same terms as Perl itself.
</p>
87 <table border=
"0" width=
"100%" cellspacing=
"0" cellpadding=
"3">
88 <tr><td class=
"block" style=
"background-color: #cccccc" valign=
"middle">
89 <big><strong><span class=
"block"> Errno - System errno constants
</span></strong></big>