Install Perl 5.8.8
[msysgit.git] / mingw / html / lib / Errno.html
blob413dbedea91821abfdfdacea5470982e4ebc4c8d
1 <?xml version="1.0" ?>
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">
4 <head>
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:" />
8 </head>
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">&nbsp;Errno - System errno constants</span></strong></big>
14 </td></tr>
15 </table>
17 <p><a name="__index__"></a></p>
18 <!-- INDEX BEGIN -->
20 <ul>
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>
28 </ul>
29 <!-- INDEX END -->
31 <hr />
32 <p>
33 </p>
34 <h1><a name="name">NAME</a></h1>
35 <p>Errno - System errno constants</p>
36 <p>
37 </p>
38 <hr />
39 <h1><a name="synopsis">SYNOPSIS</a></h1>
40 <pre>
41 use Errno qw(EINTR EIO :POSIX);</pre>
42 <p>
43 </p>
44 <hr />
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>
51 <pre>
52 use Errno;</pre>
53 <pre>
54 unless (open(FH, &quot;/fangorn/spouse&quot;)) {
55 if ($!{ENOENT}) {
56 warn &quot;Get a wife!\n&quot;;
57 } else {
58 warn &quot;This path is barred: $!&quot;;
60 }</pre>
61 <p>If a specified constant <code>EFOO</code> does not exist on the system, <code>$!{EFOO}</code>
62 returns <code>&quot;&quot;</code>. You may use <code>exists $!{EFOO}</code> to check whether the
63 constant is available on the system.</p>
64 <p>
65 </p>
66 <hr />
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>
71 <pre>
72 if (exists &amp;Errno::EFOO) {
73 $! = &amp;Errno::EFOO;
74 }</pre>
75 <p>
76 </p>
77 <hr />
78 <h1><a name="author">AUTHOR</a></h1>
79 <p>Graham Barr &lt;<a href="mailto:gbarr@pobox.com">gbarr@pobox.com</a>&gt;</p>
80 <p>
81 </p>
82 <hr />
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">&nbsp;Errno - System errno constants</span></strong></big>
90 </td></tr>
91 </table>
93 </body>
95 </html>