Install Perl 5.8.8
[msysgit.git] / mingw / html / pod / perlport.html
blob01e6f5e182af80121b8e49769c084985db879229
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>perlport - Writing portable Perl</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;perlport - Writing portable Perl</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="#description">DESCRIPTION</a></li>
24 <li><a href="#issues">ISSUES</a></li>
25 <ul>
27 <li><a href="#newlines">Newlines</a></li>
28 <li><a href="#numbers_endianness_and_width">Numbers endianness and Width</a></li>
29 <li><a href="#files_and_filesystems">Files and Filesystems</a></li>
30 <li><a href="#system_interaction">System Interaction</a></li>
31 <li><a href="#command_names_versus_file_pathnames">Command names versus file pathnames</a></li>
32 <li><a href="#networking">Networking</a></li>
33 <li><a href="#interprocess_communication__ipc_">Interprocess Communication (IPC)</a></li>
34 <li><a href="#external_subroutines__xs_">External Subroutines (XS)</a></li>
35 <li><a href="#standard_modules">Standard Modules</a></li>
36 <li><a href="#time_and_date">Time and Date</a></li>
37 <li><a href="#character_sets_and_character_encoding">Character sets and character encoding</a></li>
38 <li><a href="#internationalisation">Internationalisation</a></li>
39 <li><a href="#system_resources">System Resources</a></li>
40 <li><a href="#security">Security</a></li>
41 <li><a href="#style">Style</a></li>
42 </ul>
44 <li><a href="#cpan_testers">CPAN Testers</a></li>
45 <li><a href="#platforms">PLATFORMS</a></li>
46 <ul>
48 <li><a href="#unix">Unix</a></li>
49 <li><a href="#dos_and_derivatives">DOS and Derivatives</a></li>
50 <li><a href="#mac_os">Mac&nbsp;OS</a></li>
51 <li><a href="#vms">VMS</a></li>
52 <li><a href="#vos">VOS</a></li>
53 <li><a href="#ebcdic_platforms">EBCDIC Platforms</a></li>
54 <li><a href="#acorn_risc_os">Acorn RISC OS</a></li>
55 <li><a href="#other_perls">Other perls</a></li>
56 </ul>
58 <li><a href="#function_implementations">FUNCTION IMPLEMENTATIONS</a></li>
59 <ul>
61 <li><a href="#alphabetical_listing_of_perl_functions">Alphabetical Listing of Perl Functions</a></li>
62 </ul>
64 <li><a href="#supported_platforms">Supported Platforms</a></li>
65 <li><a href="#see_also">SEE ALSO</a></li>
66 <li><a href="#authors___contributors">AUTHORS / CONTRIBUTORS</a></li>
67 </ul>
68 <!-- INDEX END -->
70 <hr />
71 <p>
72 </p>
73 <h1><a name="name">NAME</a></h1>
74 <p>perlport - Writing portable Perl</p>
75 <p>
76 </p>
77 <hr />
78 <h1><a name="description">DESCRIPTION</a></h1>
79 <p>Perl runs on numerous operating systems. While most of them share
80 much in common, they also have their own unique features.</p>
81 <p>This document is meant to help you to find out what constitutes portable
82 Perl code. That way once you make a decision to write portably,
83 you know where the lines are drawn, and you can stay within them.</p>
84 <p>There is a tradeoff between taking full advantage of one particular
85 type of computer and taking advantage of a full range of them.
86 Naturally, as you broaden your range and become more diverse, the
87 common factors drop, and you are left with an increasingly smaller
88 area of common ground in which you can operate to accomplish a
89 particular task. Thus, when you begin attacking a problem, it is
90 important to consider under which part of the tradeoff curve you
91 want to operate. Specifically, you must decide whether it is
92 important that the task that you are coding have the full generality
93 of being portable, or whether to just get the job done right now.
94 This is the hardest choice to be made. The rest is easy, because
95 Perl provides many choices, whichever way you want to approach your
96 problem.</p>
97 <p>Looking at it another way, writing portable code is usually about
98 willfully limiting your available choices. Naturally, it takes
99 discipline and sacrifice to do that. The product of portability
100 and convenience may be a constant. You have been warned.</p>
101 <p>Be aware of two important points:</p>
102 <dl>
103 <dt><strong><a name="item_not_all_perl_programs_have_to_be_portable">Not all Perl programs have to be portable</a></strong>
105 <dd>
106 <p>There is no reason you should not use Perl as a language to glue Unix
107 tools together, or to prototype a Macintosh application, or to manage the
108 Windows registry. If it makes no sense to aim for portability for one
109 reason or another in a given program, then don't bother.</p>
110 </dd>
111 </li>
112 <dt><strong><a name="item_nearly_all_of_perl_already_is_portable">Nearly all of Perl already <em>is</em> portable</a></strong>
114 <dd>
115 <p>Don't be fooled into thinking that it is hard to create portable Perl
116 code. It isn't. Perl tries its level-best to bridge the gaps between
117 what's available on different platforms, and all the means available to
118 use those features. Thus almost all Perl code runs on any machine
119 without modification. But there are some significant issues in
120 writing portable code, and this document is entirely about those issues.</p>
121 </dd>
122 </li>
123 </dl>
124 <p>Here's the general rule: When you approach a task commonly done
125 using a whole range of platforms, think about writing portable
126 code. That way, you don't sacrifice much by way of the implementation
127 choices you can avail yourself of, and at the same time you can give
128 your users lots of platform choices. On the other hand, when you have to
129 take advantage of some unique feature of a particular platform, as is
130 often the case with systems programming (whether for Unix, Windows,
131 Mac&nbsp;OS, VMS, etc.), consider writing platform-specific code.</p>
132 <p>When the code will run on only two or three operating systems, you
133 may need to consider only the differences of those particular systems.
134 The important thing is to decide where the code will run and to be
135 deliberate in your decision.</p>
136 <p>The material below is separated into three main sections: main issues of
137 portability (<a href="#issues">ISSUES</a>), platform-specific issues (<a href="#platforms">PLATFORMS</a>), and
138 built-in perl functions that behave differently on various ports
139 (<a href="#function_implementations">FUNCTION IMPLEMENTATIONS</a>).</p>
140 <p>This information should not be considered complete; it includes possibly
141 transient information about idiosyncrasies of some of the ports, almost
142 all of which are in a state of constant evolution. Thus, this material
143 should be considered a perpetual work in progress
144 (<code>&lt;IMG SRC=&quot;yellow_sign.gif&quot; ALT=&quot;Under Construction&quot;&gt;</code>).</p>
146 </p>
147 <hr />
148 <h1><a name="issues">ISSUES</a></h1>
150 </p>
151 <h2><a name="newlines">Newlines</a></h2>
152 <p>In most operating systems, lines in files are terminated by newlines.
153 Just what is used as a newline may vary from OS to OS. Unix
154 traditionally uses <code>\012</code>, one type of DOSish I/O uses <code>\015\012</code>,
155 and Mac&nbsp;OS uses <code>\015</code>.</p>
156 <p>Perl uses <code>\n</code> to represent the ``logical'' newline, where what is
157 logical may depend on the platform in use. In MacPerl, <code>\n</code> always
158 means <code>\015</code>. In DOSish perls, <code>\n</code> usually means <code>\012</code>, but
159 when accessing a file in ``text'' mode, STDIO translates it to (or
160 from) <code>\015\012</code>, depending on whether you're reading or writing.
161 Unix does the same thing on ttys in canonical mode. <code>\015\012</code>
162 is commonly referred to as CRLF.</p>
163 <p>A common cause of unportable programs is the misuse of <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_chop"><code>chop()</code></a> to trim
164 newlines:</p>
165 <pre>
166 # XXX UNPORTABLE!
167 while(&lt;FILE&gt;) {
168 chop;
169 @array = split(/:/);
170 #...
171 }</pre>
172 <p>You can get away with this on Unix and Mac OS (they have a single
173 character end-of-line), but the same program will break under DOSish
174 perls because you're only chop()ing half the end-of-line. Instead,
175 <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_chomp"><code>chomp()</code></a> should be used to trim newlines. The <a href="file://C|\msysgit\mingw\html/Dunce/Files.html">the Dunce::Files manpage</a> module
176 can help audit your code for misuses of chop().</p>
177 <p>When dealing with binary files (or text files in binary mode) be sure
178 to explicitly set $/ to the appropriate value for your file format
179 before using chomp().</p>
180 <p>Because of the ``text'' mode translation, DOSish perls have limitations
181 in using <code>seek</code> and <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_tell"><code>tell</code></a> on a file accessed in ``text'' mode.
182 Stick to <code>seek</code>-ing to locations you got from <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_tell"><code>tell</code></a> (and no
183 others), and you are usually free to use <code>seek</code> and <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_tell"><code>tell</code></a> even
184 in ``text'' mode. Using <code>seek</code> or <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_tell"><code>tell</code></a> or other file operations
185 may be non-portable. If you use <a href="#item_binmode"><code>binmode</code></a> on a file, however, you
186 can usually <code>seek</code> and <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_tell"><code>tell</code></a> with arbitrary values in safety.</p>
187 <p>A common misconception in socket programming is that <code>\n</code> eq <code>\012</code>
188 everywhere. When using protocols such as common Internet protocols,
189 <code>\012</code> and <code>\015</code> are called for specifically, and the values of
190 the logical <code>\n</code> and <code>\r</code> (carriage return) are not reliable.</p>
191 <pre>
192 print SOCKET &quot;Hi there, client!\r\n&quot;; # WRONG
193 print SOCKET &quot;Hi there, client!\015\012&quot;; # RIGHT</pre>
194 <p>However, using <code>\015\012</code> (or <code>\cM\cJ</code>, or <code>\x0D\x0A</code>) can be tedious
195 and unsightly, as well as confusing to those maintaining the code. As
196 such, the Socket module supplies the Right Thing for those who want it.</p>
197 <pre>
198 use Socket qw(:DEFAULT :crlf);
199 print SOCKET &quot;Hi there, client!$CRLF&quot; # RIGHT</pre>
200 <p>When reading from a socket, remember that the default input record
201 separator <a href="file://C|\msysgit\mingw\html/pod/perlvar.html#item___"><code>$/</code></a> is <code>\n</code>, but robust socket code will recognize as
202 either <code>\012</code> or <code>\015\012</code> as end of line:</p>
203 <pre>
204 while (&lt;SOCKET&gt;) {
205 # ...
206 }</pre>
207 <p>Because both CRLF and LF end in LF, the input record separator can
208 be set to LF and any CR stripped later. Better to write:</p>
209 <pre>
210 use Socket qw(:DEFAULT :crlf);
211 local($/) = LF; # not needed if $/ is already \012</pre>
212 <pre>
213 while (&lt;SOCKET&gt;) {
214 s/$CR?$LF/\n/; # not sure if socket uses LF or CRLF, OK
215 # s/\015?\012/\n/; # same thing
216 }</pre>
217 <p>This example is preferred over the previous one--even for Unix
218 platforms--because now any <code>\015</code>'s (<code>\cM</code>'s) are stripped out
219 (and there was much rejoicing).</p>
220 <p>Similarly, functions that return text data--such as a function that
221 fetches a web page--should sometimes translate newlines before
222 returning the data, if they've not yet been translated to the local
223 newline representation. A single line of code will often suffice:</p>
224 <pre>
225 $data =~ s/\015?\012/\n/g;
226 return $data;</pre>
227 <p>Some of this may be confusing. Here's a handy reference to the ASCII CR
228 and LF characters. You can print it out and stick it in your wallet.</p>
229 <pre>
230 LF eq \012 eq \x0A eq \cJ eq chr(10) eq ASCII 10
231 CR eq \015 eq \x0D eq \cM eq chr(13) eq ASCII 13</pre>
232 <pre>
233 | Unix | DOS | Mac |
234 ---------------------------
235 \n | LF | LF | CR |
236 \r | CR | CR | LF |
237 \n * | LF | CRLF | CR |
238 \r * | CR | CR | LF |
239 ---------------------------
240 * text-mode STDIO</pre>
241 <p>The Unix column assumes that you are not accessing a serial line
242 (like a tty) in canonical mode. If you are, then CR on input becomes
243 ``\n'', and ``\n'' on output becomes CRLF.</p>
244 <p>These are just the most common definitions of <code>\n</code> and <code>\r</code> in Perl.
245 There may well be others. For example, on an EBCDIC implementation
246 such as z/OS (OS/390) or OS/400 (using the ILE, the PASE is ASCII-based)
247 the above material is similar to ``Unix'' but the code numbers change:</p>
248 <pre>
249 LF eq \025 eq \x15 eq \cU eq chr(21) eq CP-1047 21
250 LF eq \045 eq \x25 eq chr(37) eq CP-0037 37
251 CR eq \015 eq \x0D eq \cM eq chr(13) eq CP-1047 13
252 CR eq \015 eq \x0D eq \cM eq chr(13) eq CP-0037 13</pre>
253 <pre>
254 | z/OS | OS/400 |
255 ----------------------
256 \n | LF | LF |
257 \r | CR | CR |
258 \n * | LF | LF |
259 \r * | CR | CR |
260 ----------------------
261 * text-mode STDIO</pre>
263 </p>
264 <h2><a name="numbers_endianness_and_width">Numbers endianness and Width</a></h2>
265 <p>Different CPUs store integers and floating point numbers in different
266 orders (called <em>endianness</em>) and widths (32-bit and 64-bit being the
267 most common today). This affects your programs when they attempt to transfer
268 numbers in binary format from one CPU architecture to another,
269 usually either ``live'' via network connection, or by storing the
270 numbers to secondary storage such as a disk file or tape.</p>
271 <p>Conflicting storage orders make utter mess out of the numbers. If a
272 little-endian host (Intel, VAX) stores 0x12345678 (305419896 in
273 decimal), a big-endian host (Motorola, Sparc, PA) reads it as
274 0x78563412 (2018915346 in decimal). Alpha and MIPS can be either:
275 Digital/Compaq used/uses them in little-endian mode; SGI/Cray uses
276 them in big-endian mode. To avoid this problem in network (socket)
277 connections use the <code>pack</code> and <code>unpack</code> formats <a href="file://C|\msysgit\mingw\html/pod/perlguts.html#item_n"><code>n</code></a> and <code>N</code>, the
278 ``network'' orders. These are guaranteed to be portable.</p>
279 <p>As of perl 5.8.5, you can also use the <code>&gt;</code> and <code>&lt;</code> modifiers
280 to force big- or little-endian byte-order. This is useful if you want
281 to store signed integers or 64-bit integers, for example.</p>
282 <p>You can explore the endianness of your platform by unpacking a
283 data structure packed in native format such as:</p>
284 <pre>
285 print unpack(&quot;h*&quot;, pack(&quot;s2&quot;, 1, 2)), &quot;\n&quot;;
286 # '10002000' on e.g. Intel x86 or Alpha 21064 in little-endian mode
287 # '00100020' on e.g. Motorola 68040</pre>
288 <p>If you need to distinguish between endian architectures you could use
289 either of the variables set like so:</p>
290 <pre>
291 $is_big_endian = unpack(&quot;h*&quot;, pack(&quot;s&quot;, 1)) =~ /01/;
292 $is_little_endian = unpack(&quot;h*&quot;, pack(&quot;s&quot;, 1)) =~ /^1/;</pre>
293 <p>Differing widths can cause truncation even between platforms of equal
294 endianness. The platform of shorter width loses the upper parts of the
295 number. There is no good solution for this problem except to avoid
296 transferring or storing raw binary numbers.</p>
297 <p>One can circumnavigate both these problems in two ways. Either
298 transfer and store numbers always in text format, instead of raw
299 binary, or else consider using modules like Data::Dumper (included in
300 the standard distribution as of Perl 5.005) and Storable (included as
301 of perl 5.8). Keeping all data as text significantly simplifies matters.</p>
302 <p>The v-strings are portable only up to v2147483647 (0x7FFFFFFF), that's
303 how far EBCDIC, or more precisely UTF-EBCDIC will go.</p>
305 </p>
306 <h2><a name="files_and_filesystems">Files and Filesystems</a></h2>
307 <p>Most platforms these days structure files in a hierarchical fashion.
308 So, it is reasonably safe to assume that all platforms support the
309 notion of a ``path'' to uniquely identify a file on the system. How
310 that path is really written, though, differs considerably.</p>
311 <p>Although similar, file path specifications differ between Unix,
312 Windows, Mac&nbsp;OS, OS/2, VMS, VOS, RISC&nbsp;OS, and probably others.
313 Unix, for example, is one of the few OSes that has the elegant idea
314 of a single root directory.</p>
315 <p>DOS, OS/2, VMS, VOS, and Windows can work similarly to Unix with <code>/</code>
316 as path separator, or in their own idiosyncratic ways (such as having
317 several root directories and various ``unrooted'' device files such NIL:
318 and LPT:).</p>
319 <p>Mac&nbsp;OS uses <code>:</code> as a path separator instead of <code>/</code>.</p>
320 <p>The filesystem may support neither hard links (<a href="#item_link"><code>link</code></a>) nor
321 symbolic links (<a href="#item_symlink"><code>symlink</code></a>, <a href="#item_readlink"><code>readlink</code></a>, <a href="#item_lstat"><code>lstat</code></a>).</p>
322 <p>The filesystem may support neither access timestamp nor change
323 timestamp (meaning that about the only portable timestamp is the
324 modification timestamp), or one second granularity of any timestamps
325 (e.g. the FAT filesystem limits the time granularity to two seconds).</p>
326 <p>The ``inode change timestamp'' (the <code>-C</code> filetest) may really be the
327 ``creation timestamp'' (which it is not in UNIX).</p>
328 <p>VOS perl can emulate Unix filenames with <code>/</code> as path separator. The
329 native pathname characters greater-than, less-than, number-sign, and
330 percent-sign are always accepted.</p>
331 <p>RISC&nbsp;OS perl can emulate Unix filenames with <code>/</code> as path
332 separator, or go native and use <code>.</code> for path separator and <code>:</code> to
333 signal filesystems and disk names.</p>
334 <p>Don't assume UNIX filesystem access semantics: that read, write,
335 and execute are all the permissions there are, and even if they exist,
336 that their semantics (for example what do r, w, and x mean on
337 a directory) are the UNIX ones. The various UNIX/POSIX compatibility
338 layers usually try to make interfaces like <a href="#item_chmod"><code>chmod()</code></a> work, but sometimes
339 there simply is no good mapping.</p>
340 <p>If all this is intimidating, have no (well, maybe only a little)
341 fear. There are modules that can help. The File::Spec modules
342 provide methods to do the Right Thing on whatever platform happens
343 to be running the program.</p>
344 <pre>
345 use File::Spec::Functions;
346 chdir(updir()); # go up one directory
347 $file = catfile(curdir(), 'temp', 'file.txt');
348 # on Unix and Win32, './temp/file.txt'
349 # on Mac OS, ':temp:file.txt'
350 # on VMS, '[.temp]file.txt'</pre>
351 <p>File::Spec is available in the standard distribution as of version
352 5.004_05. File::Spec::Functions is only in File::Spec 0.7 and later,
353 and some versions of perl come with version 0.6. If File::Spec
354 is not updated to 0.7 or later, you must use the object-oriented
355 interface from File::Spec (or upgrade File::Spec).</p>
356 <p>In general, production code should not have file paths hardcoded.
357 Making them user-supplied or read from a configuration file is
358 better, keeping in mind that file path syntax varies on different
359 machines.</p>
360 <p>This is especially noticeable in scripts like Makefiles and test suites,
361 which often assume <code>/</code> as a path separator for subdirectories.</p>
362 <p>Also of use is File::Basename from the standard distribution, which
363 splits a pathname into pieces (base filename, full path to directory,
364 and file suffix).</p>
365 <p>Even when on a single platform (if you can call Unix a single platform),
366 remember not to count on the existence or the contents of particular
367 system-specific files or directories, like <em>/etc/passwd</em>,
368 <em>/etc/sendmail.conf</em>, <em>/etc/resolv.conf</em>, or even <em>/tmp/</em>. For
369 example, <em>/etc/passwd</em> may exist but not contain the encrypted
370 passwords, because the system is using some form of enhanced security.
371 Or it may not contain all the accounts, because the system is using NIS.
372 If code does need to rely on such a file, include a description of the
373 file and its format in the code's documentation, then make it easy for
374 the user to override the default location of the file.</p>
375 <p>Don't assume a text file will end with a newline. They should,
376 but people forget.</p>
377 <p>Do not have two files or directories of the same name with different
378 case, like <em>test.pl</em> and <em>Test.pl</em>, as many platforms have
379 case-insensitive (or at least case-forgiving) filenames. Also, try
380 not to have non-word characters (except for <code>.</code>) in the names, and
381 keep them to the 8.3 convention, for maximum portability, onerous a
382 burden though this may appear.</p>
383 <p>Likewise, when using the AutoSplit module, try to keep your functions to
384 8.3 naming and case-insensitive conventions; or, at the least,
385 make it so the resulting files have a unique (case-insensitively)
386 first 8 characters.</p>
387 <p>Whitespace in filenames is tolerated on most systems, but not all,
388 and even on systems where it might be tolerated, some utilities
389 might become confused by such whitespace.</p>
390 <p>Many systems (DOS, VMS) cannot have more than one <code>.</code> in their filenames.</p>
391 <p>Don't assume <code>&gt;</code> won't be the first character of a filename.
392 Always use <code>&lt;</code> explicitly to open a file for reading, or even
393 better, use the three-arg version of open, unless you want the user to
394 be able to specify a pipe open.</p>
395 <pre>
396 open(FILE, '&lt;', $existing_file) or die $!;</pre>
397 <p>If filenames might use strange characters, it is safest to open it
398 with <a href="#item_sysopen"><code>sysopen</code></a> instead of <a href="#item_open"><code>open</code></a>. <a href="#item_open"><code>open</code></a> is magic and can
399 translate characters like <code>&gt;</code>, <code>&lt;</code>, and <code>|</code>, which may
400 be the wrong thing to do. (Sometimes, though, it's the right thing.)
401 Three-arg open can also help protect against this translation in cases
402 where it is undesirable.</p>
403 <p>Don't use <code>:</code> as a part of a filename since many systems use that for
404 their own semantics (Mac OS Classic for separating pathname components,
405 many networking schemes and utilities for separating the nodename and
406 the pathname, and so on). For the same reasons, avoid <code>@</code>, <code>;</code> and
407 <code>|</code>.</p>
408 <p>Don't assume that in pathnames you can collapse two leading slashes
409 <code>//</code> into one: some networking and clustering filesystems have special
410 semantics for that. Let the operating system to sort it out.</p>
411 <p>The <em>portable filename characters</em> as defined by ANSI C are</p>
412 <pre>
413 a b c d e f g h i j k l m n o p q r t u v w x y z
414 A B C D E F G H I J K L M N O P Q R T U V W X Y Z
415 0 1 2 3 4 5 6 7 8 9
416 . _ -</pre>
417 <p>and the ``-'' shouldn't be the first character. If you want to be
418 hypercorrect, stay case-insensitive and within the 8.3 naming
419 convention (all the files and directories have to be unique within one
420 directory if their names are lowercased and truncated to eight
421 characters before the <code>.</code>, if any, and to three characters after the
422 <code>.</code>, if any). (And do not use <code>.</code>s in directory names.)</p>
424 </p>
425 <h2><a name="system_interaction">System Interaction</a></h2>
426 <p>Not all platforms provide a command line. These are usually platforms
427 that rely primarily on a Graphical User Interface (GUI) for user
428 interaction. A program requiring a command line interface might
429 not work everywhere. This is probably for the user of the program
430 to deal with, so don't stay up late worrying about it.</p>
431 <p>Some platforms can't delete or rename files held open by the system,
432 this limitation may also apply to changing filesystem metainformation
433 like file permissions or owners. Remember to <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_close"><code>close</code></a> files when you
434 are done with them. Don't <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_unlink"><code>unlink</code></a> or <a href="#item_rename"><code>rename</code></a> an open file. Don't
435 <code>tie</code> or <a href="#item_open"><code>open</code></a> a file already tied or opened; <code>untie</code> or <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_close"><code>close</code></a>
436 it first.</p>
437 <p>Don't open the same file more than once at a time for writing, as some
438 operating systems put mandatory locks on such files.</p>
439 <p>Don't assume that write/modify permission on a directory gives the
440 right to add or delete files/directories in that directory. That is
441 filesystem specific: in some filesystems you need write/modify
442 permission also (or even just) in the file/directory itself. In some
443 filesystems (AFS, DFS) the permission to add/delete directory entries
444 is a completely separate permission.</p>
445 <p>Don't assume that a single <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_unlink"><code>unlink</code></a> completely gets rid of the file:
446 some filesystems (most notably the ones in VMS) have versioned
447 filesystems, and <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_unlink"><code>unlink()</code></a> removes only the most recent one (it doesn't
448 remove all the versions because by default the native tools on those
449 platforms remove just the most recent version, too). The portable
450 idiom to remove all the versions of a file is</p>
451 <pre>
452 1 while unlink &quot;file&quot;;</pre>
453 <p>This will terminate if the file is undeleteable for some reason
454 (protected, not there, and so on).</p>
455 <p>Don't count on a specific environment variable existing in <a href="file://C|\msysgit\mingw\html/pod/perlvar.html#item__env"><code>%ENV</code></a>.
456 Don't count on <a href="file://C|\msysgit\mingw\html/pod/perlvar.html#item__env"><code>%ENV</code></a> entries being case-sensitive, or even
457 case-preserving. Don't try to clear %ENV by saying <a href="file://C|\msysgit\mingw\html/pod/perlvar.html#item__env"><code>%ENV = ();</code></a>, or,
458 if you really have to, make it conditional on <a href="file://C|\msysgit\mingw\html/pod/perlvar.html#item___o"><code>$^O ne 'VMS'</code></a> since in
459 VMS the <a href="file://C|\msysgit\mingw\html/pod/perlvar.html#item__env"><code>%ENV</code></a> table is much more than a per-process key-value string
460 table.</p>
461 <p>Don't count on signals or <a href="file://C|\msysgit\mingw\html/pod/perlvar.html#item__sig"><code>%SIG</code></a> for anything.</p>
462 <p>Don't count on filename globbing. Use <code>opendir</code>, <code>readdir</code>, and
463 <code>closedir</code> instead.</p>
464 <p>Don't count on per-program environment variables, or per-program current
465 directories.</p>
466 <p>Don't count on specific values of <a href="file://C|\msysgit\mingw\html/pod/perlvar.html#item___"><code>$!</code></a>, neither numeric nor
467 especially the strings values-- users may switch their locales causing
468 error messages to be translated into their languages. If you can
469 trust a POSIXish environment, you can portably use the symbols defined
470 by the Errno module, like ENOENT. And don't trust on the values of <a href="file://C|\msysgit\mingw\html/pod/perlvar.html#item___"><code>$!</code></a>
471 at all except immediately after a failed system call.</p>
473 </p>
474 <h2><a name="command_names_versus_file_pathnames">Command names versus file pathnames</a></h2>
475 <p>Don't assume that the name used to invoke a command or program with
476 <a href="#item_system"><code>system</code></a> or <a href="#item_exec"><code>exec</code></a> can also be used to test for the existence of the
477 file that holds the executable code for that command or program.
478 First, many systems have ``internal'' commands that are built-in to the
479 shell or OS and while these commands can be invoked, there is no
480 corresponding file. Second, some operating systems (e.g., Cygwin,
481 DJGPP, OS/2, and VOS) have required suffixes for executable files;
482 these suffixes are generally permitted on the command name but are not
483 required. Thus, a command like ``perl'' might exist in a file named
484 ``perl'', ``perl.exe'', or ``perl.pm'', depending on the operating system.
485 The variable ``_exe'' in the Config module holds the executable suffix,
486 if any. Third, the VMS port carefully sets up $^X and
487 $Config{perlpath} so that no further processing is required. This is
488 just as well, because the matching regular expression used below would
489 then have to deal with a possible trailing version number in the VMS
490 file name.</p>
491 <p>To convert $^X to a file pathname, taking account of the requirements
492 of the various operating system possibilities, say:</p>
493 <pre>
494 use Config;
495 $thisperl = $^X;
496 if ($^O ne 'VMS')
497 {$thisperl .= $Config{_exe} unless $thisperl =~ m/$Config{_exe}$/i;}</pre>
498 <p>To convert $Config{perlpath} to a file pathname, say:</p>
499 <pre>
500 use Config;
501 $thisperl = $Config{perlpath};
502 if ($^O ne 'VMS')
503 {$thisperl .= $Config{_exe} unless $thisperl =~ m/$Config{_exe}$/i;}</pre>
505 </p>
506 <h2><a name="networking">Networking</a></h2>
507 <p>Don't assume that you can reach the public Internet.</p>
508 <p>Don't assume that there is only one way to get through firewalls
509 to the public Internet.</p>
510 <p>Don't assume that you can reach outside world through any other port
511 than 80, or some web proxy. ftp is blocked by many firewalls.</p>
512 <p>Don't assume that you can send email by connecting to the local SMTP port.</p>
513 <p>Don't assume that you can reach yourself or any node by the name
514 'localhost'. The same goes for '127.0.0.1'. You will have to try both.</p>
515 <p>Don't assume that the host has only one network card, or that it
516 can't bind to many virtual IP addresses.</p>
517 <p>Don't assume a particular network device name.</p>
518 <p>Don't assume a particular set of ioctl()s will work.</p>
519 <p>Don't assume that you can ping hosts and get replies.</p>
520 <p>Don't assume that any particular port (service) will respond.</p>
521 <p>Don't assume that Sys::Hostname (or any other API or command)
522 returns either a fully qualified hostname or a non-qualified hostname:
523 it all depends on how the system had been configured. Also remember
524 things like DHCP and NAT-- the hostname you get back might not be very
525 useful.</p>
526 <p>All the above ``don't'':s may look daunting, and they are -- but the key
527 is to degrade gracefully if one cannot reach the particular network
528 service one wants. Croaking or hanging do not look very professional.</p>
530 </p>
531 <h2><a name="interprocess_communication__ipc_">Interprocess Communication (IPC)</a></h2>
532 <p>In general, don't directly access the system in code meant to be
533 portable. That means, no <a href="#item_system"><code>system</code></a>, <a href="#item_exec"><code>exec</code></a>, <a href="#item_fork"><code>fork</code></a>, <a href="#item_pipe"><code>pipe</code></a>,
534 <code>``</code>, <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_qx_"><code>qx//</code></a>, <a href="#item_open"><code>open</code></a> with a <code>|</code>, nor any of the other things
535 that makes being a perl hacker worth being.</p>
536 <p>Commands that launch external processes are generally supported on
537 most platforms (though many of them do not support any type of
538 forking). The problem with using them arises from what you invoke
539 them on. External tools are often named differently on different
540 platforms, may not be available in the same location, might accept
541 different arguments, can behave differently, and often present their
542 results in a platform-dependent way. Thus, you should seldom depend
543 on them to produce consistent results. (Then again, if you're calling
544 <em>netstat -a</em>, you probably don't expect it to run on both Unix and CP/M.)</p>
545 <p>One especially common bit of Perl code is opening a pipe to <strong>sendmail</strong>:</p>
546 <pre>
547 open(MAIL, '|/usr/lib/sendmail -t')
548 or die &quot;cannot fork sendmail: $!&quot;;</pre>
549 <p>This is fine for systems programming when sendmail is known to be
550 available. But it is not fine for many non-Unix systems, and even
551 some Unix systems that may not have sendmail installed. If a portable
552 solution is needed, see the various distributions on CPAN that deal
553 with it. Mail::Mailer and Mail::Send in the MailTools distribution are
554 commonly used, and provide several mailing methods, including mail,
555 sendmail, and direct SMTP (via Net::SMTP) if a mail transfer agent is
556 not available. Mail::Sendmail is a standalone module that provides
557 simple, platform-independent mailing.</p>
558 <p>The Unix System V IPC (<code>msg*(), sem*(), shm*()</code>) is not available
559 even on all Unix platforms.</p>
560 <p>Do not use either the bare result of <code>pack(&quot;N&quot;, 10, 20, 30, 40)</code> or
561 bare v-strings (such as <code>v10.20.30.40</code>) to represent IPv4 addresses:
562 both forms just pack the four bytes into network order. That this
563 would be equal to the C language <code>in_addr</code> struct (which is what the
564 socket code internally uses) is not guaranteed. To be portable use
565 the routines of the Socket extension, such as <code>inet_aton()</code>,
566 <code>inet_ntoa()</code>, and <code>sockaddr_in()</code>.</p>
567 <p>The rule of thumb for portable code is: Do it all in portable Perl, or
568 use a module (that may internally implement it with platform-specific
569 code, but expose a common interface).</p>
571 </p>
572 <h2><a name="external_subroutines__xs_">External Subroutines (XS)</a></h2>
573 <p>XS code can usually be made to work with any platform, but dependent
574 libraries, header files, etc., might not be readily available or
575 portable, or the XS code itself might be platform-specific, just as Perl
576 code might be. If the libraries and headers are portable, then it is
577 normally reasonable to make sure the XS code is portable, too.</p>
578 <p>A different type of portability issue arises when writing XS code:
579 availability of a C compiler on the end-user's system. C brings
580 with it its own portability issues, and writing XS code will expose
581 you to some of those. Writing purely in Perl is an easier way to
582 achieve portability.</p>
584 </p>
585 <h2><a name="standard_modules">Standard Modules</a></h2>
586 <p>In general, the standard modules work across platforms. Notable
587 exceptions are the CPAN module (which currently makes connections to external
588 programs that may not be available), platform-specific modules (like
589 ExtUtils::MM_VMS), and DBM modules.</p>
590 <p>There is no one DBM module available on all platforms.
591 SDBM_File and the others are generally available on all Unix and DOSish
592 ports, but not in MacPerl, where only NBDM_File and DB_File are
593 available.</p>
594 <p>The good news is that at least some DBM module should be available, and
595 AnyDBM_File will use whichever module it can find. Of course, then
596 the code needs to be fairly strict, dropping to the greatest common
597 factor (e.g., not exceeding 1K for each record), so that it will
598 work with any DBM module. See <a href="file://C|\msysgit\mingw\html/lib/AnyDBM_File.html">the AnyDBM_File manpage</a> for more details.</p>
600 </p>
601 <h2><a name="time_and_date">Time and Date</a></h2>
602 <p>The system's notion of time of day and calendar date is controlled in
603 widely different ways. Don't assume the timezone is stored in <code>$ENV{TZ}</code>,
604 and even if it is, don't assume that you can control the timezone through
605 that variable. Don't assume anything about the three-letter timezone
606 abbreviations (for example that MST would be the Mountain Standard Time,
607 it's been known to stand for Moscow Standard Time). If you need to
608 use timezones, express them in some unambiguous format like the
609 exact number of minutes offset from UTC, or the POSIX timezone
610 format.</p>
611 <p>Don't assume that the epoch starts at 00:00:00, January 1, 1970,
612 because that is OS- and implementation-specific. It is better to
613 store a date in an unambiguous representation. The ISO 8601 standard
614 defines YYYY-MM-DD as the date format, or YYYY-MM-DDTHH-MM-SS
615 (that's a literal ``T'' separating the date from the time).
616 Please do use the ISO 8601 instead of making us to guess what
617 date 02/03/04 might be. ISO 8601 even sorts nicely as-is.
618 A text representation (like ``1987-12-18'') can be easily converted
619 into an OS-specific value using a module like Date::Parse.
620 An array of values, such as those returned by <a href="#item_localtime"><code>localtime</code></a>, can be
621 converted to an OS-specific representation using Time::Local.</p>
622 <p>When calculating specific times, such as for tests in time or date modules,
623 it may be appropriate to calculate an offset for the epoch.</p>
624 <pre>
625 require Time::Local;
626 $offset = Time::Local::timegm(0, 0, 0, 1, 0, 70);</pre>
627 <p>The value for <code>$offset</code> in Unix will be <code>0</code>, but in Mac OS will be
628 some large number. <code>$offset</code> can then be added to a Unix time value
629 to get what should be the proper value on any system.</p>
630 <p>On Windows (at least), you shouldn't pass a negative value to <a href="#item_gmtime"><code>gmtime</code></a> or
631 <a href="#item_localtime"><code>localtime</code></a>.</p>
633 </p>
634 <h2><a name="character_sets_and_character_encoding">Character sets and character encoding</a></h2>
635 <p>Assume very little about character sets.</p>
636 <p>Assume nothing about numerical values (<a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_ord"><code>ord</code></a>, <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_chr"><code>chr</code></a>) of characters.
637 Do not use explicit code point ranges (like \xHH-\xHH); use for
638 example symbolic character classes like <code>[:print:]</code>.</p>
639 <p>Do not assume that the alphabetic characters are encoded contiguously
640 (in the numeric sense). There may be gaps.</p>
641 <p>Do not assume anything about the ordering of the characters.
642 The lowercase letters may come before or after the uppercase letters;
643 the lowercase and uppercase may be interlaced so that both ``a'' and ``A''
644 come before ``b''; the accented and other international characters may
645 be interlaced so that &auml; comes before ``b''.</p>
647 </p>
648 <h2><a name="internationalisation">Internationalisation</a></h2>
649 <p>If you may assume POSIX (a rather large assumption), you may read
650 more about the POSIX locale system from <a href="file://C|\msysgit\mingw\html/pod/perllocale.html">the perllocale manpage</a>. The locale
651 system at least attempts to make things a little bit more portable,
652 or at least more convenient and native-friendly for non-English
653 users. The system affects character sets and encoding, and date
654 and time formatting--amongst other things.</p>
655 <p>If you really want to be international, you should consider Unicode.
656 See <a href="file://C|\msysgit\mingw\html/pod/perluniintro.html">the perluniintro manpage</a> and <a href="file://C|\msysgit\mingw\html/pod/perlunicode.html">the perlunicode manpage</a> for more information.</p>
657 <p>If you want to use non-ASCII bytes (outside the bytes 0x00..0x7f) in
658 the ``source code'' of your code, to be portable you have to be explicit
659 about what bytes they are. Someone might for example be using your
660 code under a UTF-8 locale, in which case random native bytes might be
661 illegal (``Malformed UTF-8 ...'') This means that for example embedding
662 ISO 8859-1 bytes beyond 0x7f into your strings might cause trouble
663 later. If the bytes are native 8-bit bytes, you can use the <code>bytes</code>
664 pragma. If the bytes are in a string (regular expression being a
665 curious string), you can often also use the <code>\xHH</code> notation instead
666 of embedding the bytes as-is. If they are in some particular legacy
667 encoding (ether single-byte or something more complicated), you can
668 use the <code>encoding</code> pragma. (If you want to write your code in UTF-8,
669 you can use either the <code>utf8</code> pragma, or the <code>encoding</code> pragma.)
670 The <code>bytes</code> and <code>utf8</code> pragmata are available since Perl 5.6.0, and
671 the <code>encoding</code> pragma since Perl 5.8.0.</p>
673 </p>
674 <h2><a name="system_resources">System Resources</a></h2>
675 <p>If your code is destined for systems with severely constrained (or
676 missing!) virtual memory systems then you want to be <em>especially</em> mindful
677 of avoiding wasteful constructs such as:</p>
678 <pre>
679 # NOTE: this is no longer &quot;bad&quot; in perl5.005
680 for (0..10000000) {} # bad
681 for (my $x = 0; $x &lt;= 10000000; ++$x) {} # good</pre>
682 <pre>
683 @lines = &lt;VERY_LARGE_FILE&gt;; # bad</pre>
684 <pre>
685 while (&lt;FILE&gt;) {$file .= $_} # sometimes bad
686 $file = join('', &lt;FILE&gt;); # better</pre>
687 <p>The last two constructs may appear unintuitive to most people. The
688 first repeatedly grows a string, whereas the second allocates a
689 large chunk of memory in one go. On some systems, the second is
690 more efficient that the first.</p>
692 </p>
693 <h2><a name="security">Security</a></h2>
694 <p>Most multi-user platforms provide basic levels of security, usually
695 implemented at the filesystem level. Some, however, do
696 not-- unfortunately. Thus the notion of user id, or ``home'' directory,
697 or even the state of being logged-in, may be unrecognizable on many
698 platforms. If you write programs that are security-conscious, it
699 is usually best to know what type of system you will be running
700 under so that you can write code explicitly for that platform (or
701 class of platforms).</p>
702 <p>Don't assume the UNIX filesystem access semantics: the operating
703 system or the filesystem may be using some ACL systems, which are
704 richer languages than the usual rwx. Even if the rwx exist,
705 their semantics might be different.</p>
706 <p>(From security viewpoint testing for permissions before attempting to
707 do something is silly anyway: if one tries this, there is potential
708 for race conditions-- someone or something might change the
709 permissions between the permissions check and the actual operation.
710 Just try the operation.)</p>
711 <p>Don't assume the UNIX user and group semantics: especially, don't
712 expect the <a href="file://C|\msysgit\mingw\html/pod/perlvar.html#item___"><code>$&lt;</code></a> and <a href="file://C|\msysgit\mingw\html/pod/perlvar.html#item___"><code>$&gt;</code></a> (or the <a href="file://C|\msysgit\mingw\html/pod/perlvar.html#item___"><code>$(</code></a> and <a href="file://C|\msysgit\mingw\html/pod/perlvar.html#item___"><code>$)</code></a>) to work
713 for switching identities (or memberships).</p>
714 <p>Don't assume set-uid and set-gid semantics. (And even if you do,
715 think twice: set-uid and set-gid are a known can of security worms.)</p>
717 </p>
718 <h2><a name="style">Style</a></h2>
719 <p>For those times when it is necessary to have platform-specific code,
720 consider keeping the platform-specific code in one place, making porting
721 to other platforms easier. Use the Config module and the special
722 variable <a href="file://C|\msysgit\mingw\html/pod/perlvar.html#item___o"><code>$^O</code></a> to differentiate platforms, as described in
723 <a href="#platforms">PLATFORMS</a>.</p>
724 <p>Be careful in the tests you supply with your module or programs.
725 Module code may be fully portable, but its tests might not be. This
726 often happens when tests spawn off other processes or call external
727 programs to aid in the testing, or when (as noted above) the tests
728 assume certain things about the filesystem and paths. Be careful not
729 to depend on a specific output style for errors, such as when checking
730 <a href="file://C|\msysgit\mingw\html/pod/perlvar.html#item___"><code>$!</code></a> after a failed system call. Using <a href="file://C|\msysgit\mingw\html/pod/perlvar.html#item___"><code>$!</code></a> for anything else than
731 displaying it as output is doubtful (though see the Errno module for
732 testing reasonably portably for error value). Some platforms expect
733 a certain output format, and Perl on those platforms may have been
734 adjusted accordingly. Most specifically, don't anchor a regex when
735 testing an error value.</p>
737 </p>
738 <hr />
739 <h1><a name="cpan_testers">CPAN Testers</a></h1>
740 <p>Modules uploaded to CPAN are tested by a variety of volunteers on
741 different platforms. These CPAN testers are notified by mail of each
742 new upload, and reply to the list with PASS, FAIL, NA (not applicable to
743 this platform), or UNKNOWN (unknown), along with any relevant notations.</p>
744 <p>The purpose of the testing is twofold: one, to help developers fix any
745 problems in their code that crop up because of lack of testing on other
746 platforms; two, to provide users with information about whether
747 a given module works on a given platform.</p>
748 <p>Also see:</p>
749 <ul>
750 <li>
751 <p>Mailing list: <a href="mailto:cpan-testers@perl.org">cpan-testers@perl.org</a></p>
752 </li>
753 <li>
754 <p>Testing results: <a href="http://testers.cpan.org/">http://testers.cpan.org/</a></p>
755 </li>
756 </ul>
758 </p>
759 <hr />
760 <h1><a name="platforms">PLATFORMS</a></h1>
761 <p>As of version 5.002, Perl is built with a <a href="file://C|\msysgit\mingw\html/pod/perlvar.html#item___o"><code>$^O</code></a> variable that
762 indicates the operating system it was built on. This was implemented
763 to help speed up code that would otherwise have to <code>use Config</code>
764 and use the value of <code>$Config{osname}</code>. Of course, to get more
765 detailed information about the system, looking into <code>%Config</code> is
766 certainly recommended.</p>
767 <p><code>%Config</code> cannot always be trusted, however, because it was built
768 at compile time. If perl was built in one place, then transferred
769 elsewhere, some values may be wrong. The values may even have been
770 edited after the fact.</p>
772 </p>
773 <h2><a name="unix">Unix</a></h2>
774 <p>Perl works on a bewildering variety of Unix and Unix-like platforms (see
775 e.g. most of the files in the <em>hints/</em> directory in the source code kit).
776 On most of these systems, the value of <a href="file://C|\msysgit\mingw\html/pod/perlvar.html#item___o"><code>$^O</code></a> (hence <code>$Config{'osname'}</code>,
777 too) is determined either by lowercasing and stripping punctuation from the
778 first field of the string returned by typing <code>uname -a</code> (or a similar command)
779 at the shell prompt or by testing the file system for the presence of
780 uniquely named files such as a kernel or header file. Here, for example,
781 are a few of the more popular Unix flavors:</p>
782 <pre>
783 uname $^O $Config{'archname'}
784 --------------------------------------------
785 AIX aix aix
786 BSD/OS bsdos i386-bsdos
787 Darwin darwin darwin
788 dgux dgux AViiON-dgux
789 DYNIX/ptx dynixptx i386-dynixptx
790 FreeBSD freebsd freebsd-i386
791 Linux linux arm-linux
792 Linux linux i386-linux
793 Linux linux i586-linux
794 Linux linux ppc-linux
795 HP-UX hpux PA-RISC1.1
796 IRIX irix irix
797 Mac OS X darwin darwin
798 MachTen PPC machten powerpc-machten
799 NeXT 3 next next-fat
800 NeXT 4 next OPENSTEP-Mach
801 openbsd openbsd i386-openbsd
802 OSF1 dec_osf alpha-dec_osf
803 reliantunix-n svr4 RM400-svr4
804 SCO_SV sco_sv i386-sco_sv
805 SINIX-N svr4 RM400-svr4
806 sn4609 unicos CRAY_C90-unicos
807 sn6521 unicosmk t3e-unicosmk
808 sn9617 unicos CRAY_J90-unicos
809 SunOS solaris sun4-solaris
810 SunOS solaris i86pc-solaris
811 SunOS4 sunos sun4-sunos</pre>
812 <p>Because the value of <code>$Config{archname}</code> may depend on the
813 hardware architecture, it can vary more than the value of <a href="file://C|\msysgit\mingw\html/pod/perlvar.html#item___o"><code>$^O</code></a>.</p>
815 </p>
816 <h2><a name="dos_and_derivatives">DOS and Derivatives</a></h2>
817 <p>Perl has long been ported to Intel-style microcomputers running under
818 systems like PC-DOS, MS-DOS, OS/2, and most Windows platforms you can
819 bring yourself to mention (except for Windows CE, if you count that).
820 Users familiar with <em>COMMAND.COM</em> or <em>CMD.EXE</em> style shells should
821 be aware that each of these file specifications may have subtle
822 differences:</p>
823 <pre>
824 $filespec0 = &quot;c:/foo/bar/file.txt&quot;;
825 $filespec1 = &quot;c:\\foo\\bar\\file.txt&quot;;
826 $filespec2 = 'c:\foo\bar\file.txt';
827 $filespec3 = 'c:\\foo\\bar\\file.txt';</pre>
828 <p>System calls accept either <code>/</code> or <code>\</code> as the path separator.
829 However, many command-line utilities of DOS vintage treat <code>/</code> as
830 the option prefix, so may get confused by filenames containing <code>/</code>.
831 Aside from calling any external programs, <code>/</code> will work just fine,
832 and probably better, as it is more consistent with popular usage,
833 and avoids the problem of remembering what to backwhack and what
834 not to.</p>
835 <p>The DOS FAT filesystem can accommodate only ``8.3'' style filenames. Under
836 the ``case-insensitive, but case-preserving'' HPFS (OS/2) and NTFS (NT)
837 filesystems you may have to be careful about case returned with functions
838 like <code>readdir</code> or used with functions like <a href="#item_open"><code>open</code></a> or <code>opendir</code>.</p>
839 <p>DOS also treats several filenames as special, such as AUX, PRN,
840 NUL, CON, COM1, LPT1, LPT2, etc. Unfortunately, sometimes these
841 filenames won't even work if you include an explicit directory
842 prefix. It is best to avoid such filenames, if you want your code
843 to be portable to DOS and its derivatives. It's hard to know what
844 these all are, unfortunately.</p>
845 <p>Users of these operating systems may also wish to make use of
846 scripts such as <em>pl2bat.bat</em> or <em>pl2cmd</em> to
847 put wrappers around your scripts.</p>
848 <p>Newline (<code>\n</code>) is translated as <code>\015\012</code> by STDIO when reading from
849 and writing to files (see <a href="#newlines">Newlines</a>). <a href="#item_binmode"><code>binmode(FILEHANDLE)</code></a>
850 will keep <code>\n</code> translated as <code>\012</code> for that filehandle. Since it is a
851 no-op on other systems, <a href="#item_binmode"><code>binmode</code></a> should be used for cross-platform code
852 that deals with binary data. That's assuming you realize in advance
853 that your data is in binary. General-purpose programs should
854 often assume nothing about their data.</p>
855 <p>The <a href="file://C|\msysgit\mingw\html/pod/perlvar.html#item___o"><code>$^O</code></a> variable and the <code>$Config{archname}</code> values for various
856 DOSish perls are as follows:</p>
857 <pre>
858 OS $^O $Config{archname} ID Version
859 --------------------------------------------------------
860 MS-DOS dos ?
861 PC-DOS dos ?
862 OS/2 os2 ?
863 Windows 3.1 ? ? 0 3 01
864 Windows 95 MSWin32 MSWin32-x86 1 4 00
865 Windows 98 MSWin32 MSWin32-x86 1 4 10
866 Windows ME MSWin32 MSWin32-x86 1 ?
867 Windows NT MSWin32 MSWin32-x86 2 4 xx
868 Windows NT MSWin32 MSWin32-ALPHA 2 4 xx
869 Windows NT MSWin32 MSWin32-ppc 2 4 xx
870 Windows 2000 MSWin32 MSWin32-x86 2 5 00
871 Windows XP MSWin32 MSWin32-x86 2 5 01
872 Windows 2003 MSWin32 MSWin32-x86 2 5 02
873 Windows CE MSWin32 ? 3
874 Cygwin cygwin cygwin</pre>
875 <p>The various MSWin32 Perl's can distinguish the OS they are running on
876 via the value of the fifth element of the list returned from
877 Win32::GetOSVersion(). For example:</p>
878 <pre>
879 if ($^O eq 'MSWin32') {
880 my @os_version_info = Win32::GetOSVersion();
881 print +('3.1','95','NT')[$os_version_info[4]],&quot;\n&quot;;
882 }</pre>
883 <p>There are also Win32::IsWinNT() and Win32::IsWin95(), try <code>perldoc Win32</code>,
884 and as of libwin32 0.19 (not part of the core Perl distribution)
885 Win32::GetOSName(). The very portable POSIX::uname() will work too:</p>
886 <pre>
887 c:\&gt; perl -MPOSIX -we &quot;print join '|', uname&quot;
888 Windows NT|moonru|5.0|Build 2195 (Service Pack 2)|x86</pre>
889 <p>Also see:</p>
890 <ul>
891 <li>
892 <p>The djgpp environment for DOS, <a href="http://www.delorie.com/djgpp/">http://www.delorie.com/djgpp/</a>
893 and <a href="file://C|\msysgit\mingw\html/pod/perldos.html">the perldos manpage</a>.</p>
894 </li>
895 <li>
896 <p>The EMX environment for DOS, OS/2, etc. <a href="mailto:emx@iaehv.nl,">emx@iaehv.nl,</a>
897 <a href="http://www.leo.org/pub/comp/os/os2/leo/gnu/emx+gcc/index.html">http://www.leo.org/pub/comp/os/os2/leo/gnu/emx+gcc/index.html</a> or
898 <a href="ftp://hobbes.nmsu.edu/pub/os2/dev/emx/">ftp://hobbes.nmsu.edu/pub/os2/dev/emx/</a> Also <a href="file://C|\msysgit\mingw\html/pod/perlos2.html">the perlos2 manpage</a>.</p>
899 </li>
900 <li>
901 <p>Build instructions for Win32 in <a href="file://C|\msysgit\mingw\html/pod/perlwin32.html">the perlwin32 manpage</a>, or under the Cygnus environment
902 in <a href="file://C|\msysgit\mingw\html/pod/perlcygwin.html">the perlcygwin manpage</a>.</p>
903 </li>
904 <li>
905 <p>The <code>Win32::*</code> modules in <a href="file://C|\msysgit\mingw\html/lib/Win32.html">the Win32 manpage</a>.</p>
906 </li>
907 <li>
908 <p>The ActiveState Pages, <a href="http://www.activestate.com/">http://www.activestate.com/</a></p>
909 </li>
910 <li>
911 <p>The Cygwin environment for Win32; <em>README.cygwin</em> (installed
912 as <a href="file://C|\msysgit\mingw\html/pod/perlcygwin.html">the perlcygwin manpage</a>), <a href="http://www.cygwin.com/">http://www.cygwin.com/</a></p>
913 </li>
914 <li>
915 <p>The U/WIN environment for Win32,
916 <a href="http://www.research.att.com/sw/tools/uwin/">http://www.research.att.com/sw/tools/uwin/</a></p>
917 </li>
918 <li>
919 <p>Build instructions for OS/2, <a href="file://C|\msysgit\mingw\html/pod/perlos2.html">the perlos2 manpage</a></p>
920 </li>
921 </ul>
923 </p>
924 <h2><a name="mac_os">Mac&nbsp;OS</a></h2>
925 <p>Any module requiring XS compilation is right out for most people, because
926 MacPerl is built using non-free (and non-cheap!) compilers. Some XS
927 modules that can work with MacPerl are built and distributed in binary
928 form on CPAN.</p>
929 <p>Directories are specified as:</p>
930 <pre>
931 volume:folder:file for absolute pathnames
932 volume:folder: for absolute pathnames
933 :folder:file for relative pathnames
934 :folder: for relative pathnames
935 :file for relative pathnames
936 file for relative pathnames</pre>
937 <p>Files are stored in the directory in alphabetical order. Filenames are
938 limited to 31 characters, and may include any character except for
939 null and <code>:</code>, which is reserved as the path separator.</p>
940 <p>Instead of <a href="#item_flock"><code>flock</code></a>, see <code>FSpSetFLock</code> and <code>FSpRstFLock</code> in the
941 Mac::Files module, or <a href="#item_chmod"><code>chmod(0444, ...)</code></a> and <a href="#item_chmod"><code>chmod(0666, ...)</code></a>.</p>
942 <p>In the MacPerl application, you can't run a program from the command line;
943 programs that expect <a href="file://C|\msysgit\mingw\html/pod/perlvar.html#item__argv"><code>@ARGV</code></a> to be populated can be edited with something
944 like the following, which brings up a dialog box asking for the command
945 line arguments.</p>
946 <pre>
947 if (!@ARGV) {
948 @ARGV = split /\s+/, MacPerl::Ask('Arguments?');
949 }</pre>
950 <p>A MacPerl script saved as a ``droplet'' will populate <a href="file://C|\msysgit\mingw\html/pod/perlvar.html#item__argv"><code>@ARGV</code></a> with the full
951 pathnames of the files dropped onto the script.</p>
952 <p>Mac users can run programs under a type of command line interface
953 under MPW (Macintosh Programmer's Workshop, a free development
954 environment from Apple). MacPerl was first introduced as an MPW
955 tool, and MPW can be used like a shell:</p>
956 <pre>
957 perl myscript.plx some arguments</pre>
958 <p>ToolServer is another app from Apple that provides access to MPW tools
959 from MPW and the MacPerl app, which allows MacPerl programs to use
960 <a href="#item_system"><code>system</code></a>, backticks, and piped <a href="#item_open"><code>open</code></a>.</p>
961 <p>``Mac&nbsp;OS'' is the proper name for the operating system, but the value
962 in <a href="file://C|\msysgit\mingw\html/pod/perlvar.html#item___o"><code>$^O</code></a> is ``MacOS''. To determine architecture, version, or whether
963 the application or MPW tool version is running, check:</p>
964 <pre>
965 $is_app = $MacPerl::Version =~ /App/;
966 $is_tool = $MacPerl::Version =~ /MPW/;
967 ($version) = $MacPerl::Version =~ /^(\S+)/;
968 $is_ppc = $MacPerl::Architecture eq 'MacPPC';
969 $is_68k = $MacPerl::Architecture eq 'Mac68K';</pre>
970 <p>Mac&nbsp;OS&nbsp;X, based on NeXT's OpenStep OS, runs MacPerl natively, under the
971 ``Classic'' environment. There is no ``Carbon'' version of MacPerl to run
972 under the primary Mac OS X environment. Mac&nbsp;OS&nbsp;X and its Open Source
973 version, Darwin, both run Unix perl natively.</p>
974 <p>Also see:</p>
975 <ul>
976 <li>
977 <p>MacPerl Development, <a href="http://dev.macperl.org/">http://dev.macperl.org/</a> .</p>
978 </li>
979 <li>
980 <p>The MacPerl Pages, <a href="http://www.macperl.com/">http://www.macperl.com/</a> .</p>
981 </li>
982 <li>
983 <p>The MacPerl mailing lists, <a href="http://lists.perl.org/">http://lists.perl.org/</a> .</p>
984 </li>
985 <li>
986 <p>MPW, <a href="ftp://ftp.apple.com/developer/Tool_Chest/Core_Mac_OS_Tools/">ftp://ftp.apple.com/developer/Tool_Chest/Core_Mac_OS_Tools/</a></p>
987 </li>
988 </ul>
990 </p>
991 <h2><a name="vms">VMS</a></h2>
992 <p>Perl on VMS is discussed in <a href="file://C|\msysgit\mingw\html/pod/perlvms.html">the perlvms manpage</a> in the perl distribution.
993 Perl on VMS can accept either VMS- or Unix-style file
994 specifications as in either of the following:</p>
995 <pre>
996 $ perl -ne &quot;print if /perl_setup/i&quot; SYS$LOGIN:LOGIN.COM
997 $ perl -ne &quot;print if /perl_setup/i&quot; /sys$login/login.com</pre>
998 <p>but not a mixture of both as in:</p>
999 <pre>
1000 $ perl -ne &quot;print if /perl_setup/i&quot; sys$login:/login.com
1001 Can't open sys$login:/login.com: file specification syntax error</pre>
1002 <p>Interacting with Perl from the Digital Command Language (DCL) shell
1003 often requires a different set of quotation marks than Unix shells do.
1004 For example:</p>
1005 <pre>
1006 $ perl -e &quot;print &quot;&quot;Hello, world.\n&quot;&quot;&quot;
1007 Hello, world.</pre>
1008 <p>There are several ways to wrap your perl scripts in DCL <em>.COM</em> files, if
1009 you are so inclined. For example:</p>
1010 <pre>
1011 $ write sys$output &quot;Hello from DCL!&quot;
1012 $ if p1 .eqs. &quot;&quot;
1013 $ then perl -x 'f$environment(&quot;PROCEDURE&quot;)
1014 $ else perl -x - 'p1 'p2 'p3 'p4 'p5 'p6 'p7 'p8
1015 $ deck/dollars=&quot;__END__&quot;
1016 #!/usr/bin/perl</pre>
1017 <pre>
1018 print &quot;Hello from Perl!\n&quot;;</pre>
1019 <pre>
1020 __END__
1021 $ endif</pre>
1022 <p>Do take care with <code>$ ASSIGN/nolog/user SYS$COMMAND: SYS$INPUT</code> if your
1023 perl-in-DCL script expects to do things like <code>$read = &lt;STDIN&gt;;</code>.</p>
1024 <p>Filenames are in the format ``name.extension;version''. The maximum
1025 length for filenames is 39 characters, and the maximum length for
1026 extensions is also 39 characters. Version is a number from 1 to
1027 32767. Valid characters are <code>/[A-Z0-9$_-]/</code>.</p>
1028 <p>VMS's RMS filesystem is case-insensitive and does not preserve case.
1029 <code>readdir</code> returns lowercased filenames, but specifying a file for
1030 opening remains case-insensitive. Files without extensions have a
1031 trailing period on them, so doing a <code>readdir</code> with a file named <em>A.;5</em>
1032 will return <em>a.</em> (though that file could be opened with
1033 <a href="#item_open"><code>open(FH, 'A')</code></a>).</p>
1034 <p>RMS had an eight level limit on directory depths from any rooted logical
1035 (allowing 16 levels overall) prior to VMS 7.2. Hence
1036 <code>PERL_ROOT:[LIB.2.3.4.5.6.7.8]</code> is a valid directory specification but
1037 <code>PERL_ROOT:[LIB.2.3.4.5.6.7.8.9]</code> is not. <em>Makefile.PL</em> authors might
1038 have to take this into account, but at least they can refer to the former
1039 as <code>/PERL_ROOT/lib/2/3/4/5/6/7/8/</code>.</p>
1040 <p>The VMS::Filespec module, which gets installed as part of the build
1041 process on VMS, is a pure Perl module that can easily be installed on
1042 non-VMS platforms and can be helpful for conversions to and from RMS
1043 native formats.</p>
1044 <p>What <code>\n</code> represents depends on the type of file opened. It usually
1045 represents <code>\012</code> but it could also be <code>\015</code>, <code>\012</code>, <code>\015\012</code>,
1046 <code>\000</code>, <code>\040</code>, or nothing depending on the file organization and
1047 record format. The VMS::Stdio module provides access to the
1048 special <code>fopen()</code> requirements of files with unusual attributes on VMS.</p>
1049 <p>TCP/IP stacks are optional on VMS, so socket routines might not be
1050 implemented. UDP sockets may not be supported.</p>
1051 <p>The value of <a href="file://C|\msysgit\mingw\html/pod/perlvar.html#item___o"><code>$^O</code></a> on OpenVMS is ``VMS''. To determine the architecture
1052 that you are running on without resorting to loading all of <code>%Config</code>
1053 you can examine the content of the <a href="file://C|\msysgit\mingw\html/pod/perlvar.html#item__inc"><code>@INC</code></a> array like so:</p>
1054 <pre>
1055 if (grep(/VMS_AXP/, @INC)) {
1056 print &quot;I'm on Alpha!\n&quot;;</pre>
1057 <pre>
1058 } elsif (grep(/VMS_VAX/, @INC)) {
1059 print &quot;I'm on VAX!\n&quot;;</pre>
1060 <pre>
1061 } else {
1062 print &quot;I'm not so sure about where $^O is...\n&quot;;
1063 }</pre>
1064 <p>On VMS, perl determines the UTC offset from the <code>SYS$TIMEZONE_DIFFERENTIAL</code>
1065 logical name. Although the VMS epoch began at 17-NOV-1858 00:00:00.00,
1066 calls to <a href="#item_localtime"><code>localtime</code></a> are adjusted to count offsets from
1067 01-JAN-1970 00:00:00.00, just like Unix.</p>
1068 <p>Also see:</p>
1069 <ul>
1070 <li>
1071 <p><em>README.vms</em> (installed as <em>README_vms</em>), <a href="file://C|\msysgit\mingw\html/pod/perlvms.html">the perlvms manpage</a></p>
1072 </li>
1073 <li>
1074 <p>vmsperl list, <a href="mailto:majordomo@perl.org">majordomo@perl.org</a></p>
1075 <p>(Put the words <code>subscribe vmsperl</code> in message body.)</p>
1076 </li>
1077 <li>
1078 <p>vmsperl on the web, <a href="http://www.sidhe.org/vmsperl/index.html">http://www.sidhe.org/vmsperl/index.html</a></p>
1079 </li>
1080 </ul>
1082 </p>
1083 <h2><a name="vos">VOS</a></h2>
1084 <p>Perl on VOS is discussed in <em>README.vos</em> in the perl distribution
1085 (installed as <a href="file://C|\msysgit\mingw\html/pod/perlvos.html">the perlvos manpage</a>). Perl on VOS can accept either VOS- or
1086 Unix-style file specifications as in either of the following:</p>
1087 <pre>
1088 C&lt;&lt; $ perl -ne &quot;print if /perl_setup/i&quot; &gt;system&gt;notices &gt;&gt;
1089 C&lt;&lt; $ perl -ne &quot;print if /perl_setup/i&quot; /system/notices &gt;&gt;</pre>
1090 <p>or even a mixture of both as in:</p>
1091 <pre>
1092 C&lt;&lt; $ perl -ne &quot;print if /perl_setup/i&quot; &gt;system/notices &gt;&gt;</pre>
1093 <p>Even though VOS allows the slash character to appear in object
1094 names, because the VOS port of Perl interprets it as a pathname
1095 delimiting character, VOS files, directories, or links whose names
1096 contain a slash character cannot be processed. Such files must be
1097 renamed before they can be processed by Perl. Note that VOS limits
1098 file names to 32 or fewer characters.</p>
1099 <p>Perl on VOS can be built using two different compilers and two different
1100 versions of the POSIX runtime. The recommended method for building full
1101 Perl is with the GNU C compiler and the generally-available version of
1102 VOS POSIX support. See <em>README.vos</em> (installed as <a href="file://C|\msysgit\mingw\html/pod/perlvos.html">the perlvos manpage</a>) for
1103 restrictions that apply when Perl is built using the VOS Standard C
1104 compiler or the alpha version of VOS POSIX support.</p>
1105 <p>The value of <a href="file://C|\msysgit\mingw\html/pod/perlvar.html#item___o"><code>$^O</code></a> on VOS is ``VOS''. To determine the architecture that
1106 you are running on without resorting to loading all of <code>%Config</code> you
1107 can examine the content of the @INC array like so:</p>
1108 <pre>
1109 if ($^O =~ /VOS/) {
1110 print &quot;I'm on a Stratus box!\n&quot;;
1111 } else {
1112 print &quot;I'm not on a Stratus box!\n&quot;;
1113 die;
1114 }</pre>
1115 <pre>
1116 if (grep(/860/, @INC)) {
1117 print &quot;This box is a Stratus XA/R!\n&quot;;</pre>
1118 <pre>
1119 } elsif (grep(/7100/, @INC)) {
1120 print &quot;This box is a Stratus HP 7100 or 8xxx!\n&quot;;</pre>
1121 <pre>
1122 } elsif (grep(/8000/, @INC)) {
1123 print &quot;This box is a Stratus HP 8xxx!\n&quot;;</pre>
1124 <pre>
1125 } else {
1126 print &quot;This box is a Stratus 68K!\n&quot;;
1127 }</pre>
1128 <p>Also see:</p>
1129 <ul>
1130 <li>
1131 <p><em>README.vos</em> (installed as <a href="file://C|\msysgit\mingw\html/pod/perlvos.html">the perlvos manpage</a>)</p>
1132 </li>
1133 <li>
1134 <p>The VOS mailing list.</p>
1135 <p>There is no specific mailing list for Perl on VOS. You can post
1136 comments to the comp.sys.stratus newsgroup, or subscribe to the general
1137 Stratus mailing list. Send a letter with ``subscribe Info-Stratus'' in
1138 the message body to <a href="mailto:majordomo@list.stratagy.com.">majordomo@list.stratagy.com.</a></p>
1139 </li>
1140 <li>
1141 <p>VOS Perl on the web at <a href="http://ftp.stratus.com/pub/vos/posix/posix.html">http://ftp.stratus.com/pub/vos/posix/posix.html</a></p>
1142 </li>
1143 </ul>
1145 </p>
1146 <h2><a name="ebcdic_platforms">EBCDIC Platforms</a></h2>
1147 <p>Recent versions of Perl have been ported to platforms such as OS/400 on
1148 AS/400 minicomputers as well as OS/390, VM/ESA, and BS2000 for S/390
1149 Mainframes. Such computers use EBCDIC character sets internally (usually
1150 Character Code Set ID 0037 for OS/400 and either 1047 or POSIX-BC for S/390
1151 systems). On the mainframe perl currently works under the ``Unix system
1152 services for OS/390'' (formerly known as OpenEdition), VM/ESA OpenEdition, or
1153 the BS200 POSIX-BC system (BS2000 is supported in perl 5.6 and greater).
1154 See <a href="file://C|\msysgit\mingw\html/pod/perlos390.html">the perlos390 manpage</a> for details. Note that for OS/400 there is also a port of
1155 Perl 5.8.1/5.9.0 or later to the PASE which is ASCII-based (as opposed to
1156 ILE which is EBCDIC-based), see <a href="file://C|\msysgit\mingw\html/pod/perlos400.html">the perlos400 manpage</a>.</p>
1157 <p>As of R2.5 of USS for OS/390 and Version 2.3 of VM/ESA these Unix
1158 sub-systems do not support the <code>#!</code> shebang trick for script invocation.
1159 Hence, on OS/390 and VM/ESA perl scripts can be executed with a header
1160 similar to the following simple script:</p>
1161 <pre>
1162 : # use perl
1163 eval 'exec /usr/local/bin/perl -S $0 ${1+&quot;$@&quot;}'
1164 if 0;
1165 #!/usr/local/bin/perl # just a comment really</pre>
1166 <pre>
1167 print &quot;Hello from perl!\n&quot;;</pre>
1168 <p>OS/390 will support the <code>#!</code> shebang trick in release 2.8 and beyond.
1169 Calls to <a href="#item_system"><code>system</code></a> and backticks can use POSIX shell syntax on all
1170 S/390 systems.</p>
1171 <p>On the AS/400, if PERL5 is in your library list, you may need
1172 to wrap your perl scripts in a CL procedure to invoke them like so:</p>
1173 <pre>
1174 BEGIN
1175 CALL PGM(PERL5/PERL) PARM('/QOpenSys/hello.pl')
1176 ENDPGM</pre>
1177 <p>This will invoke the perl script <em>hello.pl</em> in the root of the
1178 QOpenSys file system. On the AS/400 calls to <a href="#item_system"><code>system</code></a> or backticks
1179 must use CL syntax.</p>
1180 <p>On these platforms, bear in mind that the EBCDIC character set may have
1181 an effect on what happens with some perl functions (such as <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_chr"><code>chr</code></a>,
1182 <code>pack</code>, <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_print"><code>print</code></a>, <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_printf"><code>printf</code></a>, <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_ord"><code>ord</code></a>, <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_sort"><code>sort</code></a>, <code>sprintf</code>, <code>unpack</code>), as
1183 well as bit-fiddling with ASCII constants using operators like <code>^</code>, <code>&amp;</code>
1184 and <code>|</code>, not to mention dealing with socket interfaces to ASCII computers
1185 (see <a href="#newlines">Newlines</a>).</p>
1186 <p>Fortunately, most web servers for the mainframe will correctly
1187 translate the <code>\n</code> in the following statement to its ASCII equivalent
1188 (<code>\r</code> is the same under both Unix and OS/390 &amp; VM/ESA):</p>
1189 <pre>
1190 print &quot;Content-type: text/html\r\n\r\n&quot;;</pre>
1191 <p>The values of <a href="file://C|\msysgit\mingw\html/pod/perlvar.html#item___o"><code>$^O</code></a> on some of these platforms includes:</p>
1192 <pre>
1193 uname $^O $Config{'archname'}
1194 --------------------------------------------
1195 OS/390 os390 os390
1196 OS400 os400 os400
1197 POSIX-BC posix-bc BS2000-posix-bc
1198 VM/ESA vmesa vmesa</pre>
1199 <p>Some simple tricks for determining if you are running on an EBCDIC
1200 platform could include any of the following (perhaps all):</p>
1201 <pre>
1202 if (&quot;\t&quot; eq &quot;\05&quot;) { print &quot;EBCDIC may be spoken here!\n&quot;; }</pre>
1203 <pre>
1204 if (ord('A') == 193) { print &quot;EBCDIC may be spoken here!\n&quot;; }</pre>
1205 <pre>
1206 if (chr(169) eq 'z') { print &quot;EBCDIC may be spoken here!\n&quot;; }</pre>
1207 <p>One thing you may not want to rely on is the EBCDIC encoding
1208 of punctuation characters since these may differ from code page to code
1209 page (and once your module or script is rumoured to work with EBCDIC,
1210 folks will want it to work with all EBCDIC character sets).</p>
1211 <p>Also see:</p>
1212 <ul>
1213 <li>
1214 <p><a href="file://C|\msysgit\mingw\html/pod/perlos390.html">the perlos390 manpage</a>, <em>README.os390</em>, <em>perlbs2000</em>, <em>README.vmesa</em>,
1215 <a href="file://C|\msysgit\mingw\html/pod/perlebcdic.html">the perlebcdic manpage</a>.</p>
1216 </li>
1217 <li>
1218 <p>The <a href="mailto:perl-mvs@perl.org">perl-mvs@perl.org</a> list is for discussion of porting issues as well as
1219 general usage issues for all EBCDIC Perls. Send a message body of
1220 ``subscribe perl-mvs'' to <a href="mailto:majordomo@perl.org.">majordomo@perl.org.</a></p>
1221 </li>
1222 <li>
1223 <p>AS/400 Perl information at
1224 <a href="http://as400.rochester.ibm.com/">http://as400.rochester.ibm.com/</a>
1225 as well as on CPAN in the <em>ports/</em> directory.</p>
1226 </li>
1227 </ul>
1229 </p>
1230 <h2><a name="acorn_risc_os">Acorn RISC OS</a></h2>
1231 <p>Because Acorns use ASCII with newlines (<code>\n</code>) in text files as <code>\012</code> like
1232 Unix, and because Unix filename emulation is turned on by default,
1233 most simple scripts will probably work ``out of the box''. The native
1234 filesystem is modular, and individual filesystems are free to be
1235 case-sensitive or insensitive, and are usually case-preserving. Some
1236 native filesystems have name length limits, which file and directory
1237 names are silently truncated to fit. Scripts should be aware that the
1238 standard filesystem currently has a name length limit of <strong>10</strong>
1239 characters, with up to 77 items in a directory, but other filesystems
1240 may not impose such limitations.</p>
1241 <p>Native filenames are of the form</p>
1242 <pre>
1243 Filesystem#Special_Field::DiskName.$.Directory.Directory.File</pre>
1244 <p>where</p>
1245 <pre>
1246 Special_Field is not usually present, but may contain . and $ .
1247 Filesystem =~ m|[A-Za-z0-9_]|
1248 DsicName =~ m|[A-Za-z0-9_/]|
1249 $ represents the root directory
1250 . is the path separator
1251 @ is the current directory (per filesystem but machine global)
1252 ^ is the parent directory
1253 Directory and File =~ m|[^\0- &quot;\.\$\%\&amp;:\@\\^\|\177]+|</pre>
1254 <p>The default filename translation is roughly <code>tr|/.|./|;</code></p>
1255 <p>Note that <code>&quot;ADFS::HardDisk.$.File&quot; ne 'ADFS::HardDisk.$.File'</code> and that
1256 the second stage of <code>$</code> interpolation in regular expressions will fall
1257 foul of the <a href="file://C|\msysgit\mingw\html/pod/perlvar.html#item___"><code>$.</code></a> if scripts are not careful.</p>
1258 <p>Logical paths specified by system variables containing comma-separated
1259 search lists are also allowed; hence <code>System:Modules</code> is a valid
1260 filename, and the filesystem will prefix <code>Modules</code> with each section of
1261 <code>System$Path</code> until a name is made that points to an object on disk.
1262 Writing to a new file <code>System:Modules</code> would be allowed only if
1263 <code>System$Path</code> contains a single item list. The filesystem will also
1264 expand system variables in filenames if enclosed in angle brackets, so
1265 <code>&lt;System$Dir&gt;.Modules</code> would look for the file
1266 <code>$ENV{'System$Dir'}&nbsp;.&nbsp;'Modules'</code>. The obvious implication of this is
1267 that <strong>fully qualified filenames can start with <code>&lt;&gt;</code></strong> and should
1268 be protected when <a href="#item_open"><code>open</code></a> is used for input.</p>
1269 <p>Because <code>.</code> was in use as a directory separator and filenames could not
1270 be assumed to be unique after 10 characters, Acorn implemented the C
1271 compiler to strip the trailing <code>.c</code> <code>.h</code> <code>.s</code> and <code>.o</code> suffix from
1272 filenames specified in source code and store the respective files in
1273 subdirectories named after the suffix. Hence files are translated:</p>
1274 <pre>
1275 foo.h h.foo
1276 C:foo.h C:h.foo (logical path variable)
1277 sys/os.h sys.h.os (C compiler groks Unix-speak)
1278 10charname.c c.10charname
1279 10charname.o o.10charname
1280 11charname_.c c.11charname (assuming filesystem truncates at 10)</pre>
1281 <p>The Unix emulation library's translation of filenames to native assumes
1282 that this sort of translation is required, and it allows a user-defined list
1283 of known suffixes that it will transpose in this fashion. This may
1284 seem transparent, but consider that with these rules <code>foo/bar/baz.h</code>
1285 and <code>foo/bar/h/baz</code> both map to <code>foo.bar.h.baz</code>, and that <code>readdir</code> and
1286 <a href="#item_glob"><code>glob</code></a> cannot and do not attempt to emulate the reverse mapping. Other
1287 <code>.</code>'s in filenames are translated to <code>/</code>.</p>
1288 <p>As implied above, the environment accessed through <a href="file://C|\msysgit\mingw\html/pod/perlvar.html#item__env"><code>%ENV</code></a> is global, and
1289 the convention is that program specific environment variables are of the
1290 form <code>Program$Name</code>. Each filesystem maintains a current directory,
1291 and the current filesystem's current directory is the <strong>global</strong> current
1292 directory. Consequently, sociable programs don't change the current
1293 directory but rely on full pathnames, and programs (and Makefiles) cannot
1294 assume that they can spawn a child process which can change the current
1295 directory without affecting its parent (and everyone else for that
1296 matter).</p>
1297 <p>Because native operating system filehandles are global and are currently
1298 allocated down from 255, with 0 being a reserved value, the Unix emulation
1299 library emulates Unix filehandles. Consequently, you can't rely on
1300 passing <code>STDIN</code>, <code>STDOUT</code>, or <code>STDERR</code> to your children.</p>
1301 <p>The desire of users to express filenames of the form
1302 <code>&lt;Foo$Dir&gt;.Bar</code> on the command line unquoted causes problems,
1303 too: <code>``</code> command output capture has to perform a guessing game. It
1304 assumes that a string <code>&lt;[^&lt;&gt;]+\$[^&lt;&gt;]&gt;</code> is a
1305 reference to an environment variable, whereas anything else involving
1306 <code>&lt;</code> or <code>&gt;</code> is redirection, and generally manages to be 99%
1307 right. Of course, the problem remains that scripts cannot rely on any
1308 Unix tools being available, or that any tools found have Unix-like command
1309 line arguments.</p>
1310 <p>Extensions and XS are, in theory, buildable by anyone using free
1311 tools. In practice, many don't, as users of the Acorn platform are
1312 used to binary distributions. MakeMaker does run, but no available
1313 make currently copes with MakeMaker's makefiles; even if and when
1314 this should be fixed, the lack of a Unix-like shell will cause
1315 problems with makefile rules, especially lines of the form <code>cd
1316 sdbm &amp;&amp; make all</code>, and anything using quoting.</p>
1317 <p>``RISC&nbsp;OS'' is the proper name for the operating system, but the value
1318 in <a href="file://C|\msysgit\mingw\html/pod/perlvar.html#item___o"><code>$^O</code></a> is ``riscos'' (because we don't like shouting).</p>
1320 </p>
1321 <h2><a name="other_perls">Other perls</a></h2>
1322 <p>Perl has been ported to many platforms that do not fit into any of
1323 the categories listed above. Some, such as AmigaOS, Atari MiNT,
1324 BeOS, HP MPE/iX, QNX, Plan 9, and VOS, have been well-integrated
1325 into the standard Perl source code kit. You may need to see the
1326 <em>ports/</em> directory on CPAN for information, and possibly binaries,
1327 for the likes of: aos, Atari ST, lynxos, riscos, Novell Netware,
1328 Tandem Guardian, <em>etc.</em> (Yes, we know that some of these OSes may
1329 fall under the Unix category, but we are not a standards body.)</p>
1330 <p>Some approximate operating system names and their <a href="file://C|\msysgit\mingw\html/pod/perlvar.html#item___o"><code>$^O</code></a> values
1331 in the ``OTHER'' category include:</p>
1332 <pre>
1333 OS $^O $Config{'archname'}
1334 ------------------------------------------
1335 Amiga DOS amigaos m68k-amigos
1336 BeOS beos
1337 MPE/iX mpeix PA-RISC1.1</pre>
1338 <p>See also:</p>
1339 <ul>
1340 <li>
1341 <p>Amiga, <em>README.amiga</em> (installed as <a href="file://C|\msysgit\mingw\html/pod/perlamiga.html">the perlamiga manpage</a>).</p>
1342 </li>
1343 <li>
1344 <p>Atari, <em>README.mint</em> and Guido Flohr's web page
1345 <a href="http://stud.uni-sb.de/~gufl0000/">http://stud.uni-sb.de/~gufl0000/</a></p>
1346 </li>
1347 <li>
1348 <p>Be OS, <em>README.beos</em></p>
1349 </li>
1350 <li>
1351 <p>HP 300 MPE/iX, <em>README.mpeix</em> and Mark Bixby's web page
1352 <a href="http://www.bixby.org/mark/perlix.html">http://www.bixby.org/mark/perlix.html</a></p>
1353 </li>
1354 <li>
1355 <p>A free perl5-based PERL.NLM for Novell Netware is available in
1356 precompiled binary and source code form from <a href="http://www.novell.com/">http://www.novell.com/</a>
1357 as well as from CPAN.</p>
1358 </li>
1359 <li>
1360 <p>Plan&nbsp;9, <em>README.plan9</em></p>
1361 </li>
1362 </ul>
1364 </p>
1365 <hr />
1366 <h1><a name="function_implementations">FUNCTION IMPLEMENTATIONS</a></h1>
1367 <p>Listed below are functions that are either completely unimplemented
1368 or else have been implemented differently on various platforms.
1369 Following each description will be, in parentheses, a list of
1370 platforms that the description applies to.</p>
1371 <p>The list may well be incomplete, or even wrong in some places. When
1372 in doubt, consult the platform-specific README files in the Perl
1373 source distribution, and any other documentation resources accompanying
1374 a given port.</p>
1375 <p>Be aware, moreover, that even among Unix-ish systems there are variations.</p>
1376 <p>For many functions, you can also query <code>%Config</code>, exported by
1377 default from the Config module. For example, to check whether the
1378 platform has the <a href="#item_lstat"><code>lstat</code></a> call, check <code>$Config{d_lstat}</code>. See
1379 <a href="file://C|\msysgit\mingw\html/lib/Config.html">the Config manpage</a> for a full description of available variables.</p>
1381 </p>
1382 <h2><a name="alphabetical_listing_of_perl_functions">Alphabetical Listing of Perl Functions</a></h2>
1383 <dl>
1384 <dt><strong><a name="item__2dx">-X</a></strong>
1386 <dd>
1387 <p><code>-r</code>, <code>-w</code>, and <code>-x</code> have a limited meaning only; directories
1388 and applications are executable, and there are no uid/gid
1389 considerations. <code>-o</code> is not supported. (Mac&nbsp;OS)</p>
1390 </dd>
1391 <dd>
1392 <p><code>-r</code>, <code>-w</code>, <code>-x</code>, and <code>-o</code> tell whether the file is accessible,
1393 which may not reflect UIC-based file protections. (VMS)</p>
1394 </dd>
1395 <dd>
1396 <p><code>-s</code> returns the size of the data fork, not the total size of data fork
1397 plus resource fork. (Mac&nbsp;OS).</p>
1398 </dd>
1399 <dd>
1400 <p><code>-s</code> by name on an open file will return the space reserved on disk,
1401 rather than the current extent. <code>-s</code> on an open filehandle returns the
1402 current size. (RISC&nbsp;OS)</p>
1403 </dd>
1404 <dd>
1405 <p><code>-R</code>, <code>-W</code>, <a href="#item__2dx"><code>-X</code></a>, <code>-O</code> are indistinguishable from <code>-r</code>, <code>-w</code>,
1406 <code>-x</code>, <code>-o</code>. (Mac&nbsp;OS, Win32, VMS, RISC&nbsp;OS)</p>
1407 </dd>
1408 <dd>
1409 <p><code>-b</code>, <code>-c</code>, <code>-k</code>, <code>-g</code>, <code>-p</code>, <code>-u</code>, <code>-A</code> are not implemented.
1410 (Mac&nbsp;OS)</p>
1411 </dd>
1412 <dd>
1413 <p><code>-g</code>, <code>-k</code>, <code>-l</code>, <code>-p</code>, <code>-u</code>, <code>-A</code> are not particularly meaningful.
1414 (Win32, VMS, RISC&nbsp;OS)</p>
1415 </dd>
1416 <dd>
1417 <p><code>-d</code> is true if passed a device spec without an explicit directory.
1418 (VMS)</p>
1419 </dd>
1420 <dd>
1421 <p><code>-T</code> and <code>-B</code> are implemented, but might misclassify Mac text files
1422 with foreign characters; this is the case will all platforms, but may
1423 affect Mac&nbsp;OS often. (Mac&nbsp;OS)</p>
1424 </dd>
1425 <dd>
1426 <p><code>-x</code> (or <a href="#item__2dx"><code>-X</code></a>) determine if a file ends in one of the executable
1427 suffixes. <code>-S</code> is meaningless. (Win32)</p>
1428 </dd>
1429 <dd>
1430 <p><code>-x</code> (or <a href="#item__2dx"><code>-X</code></a>) determine if a file has an executable file type.
1431 (RISC&nbsp;OS)</p>
1432 </dd>
1433 </li>
1434 <dt><strong><a name="item_atan2">atan2 Y,X</a></strong>
1436 <dd>
1437 <p>Due to issues with various CPUs, math libraries, compilers, and standards,
1438 results for <a href="#item_atan2"><code>atan2()</code></a> may vary depending on any combination of the above.
1439 Perl attempts to conform to the Open Group/IEEE standards for the results
1440 returned from <a href="#item_atan2"><code>atan2()</code></a>, but cannot force the issue if the system Perl is
1441 run on does not allow it. (Tru64, HP-UX 10.20)</p>
1442 </dd>
1443 <dd>
1444 <p>The current version of the standards for <a href="#item_atan2"><code>atan2()</code></a> is available at
1445 <a href="http://www.opengroup.org/onlinepubs/009695399/functions/atan2.html">http://www.opengroup.org/onlinepubs/009695399/functions/atan2.html</a>.</p>
1446 </dd>
1447 </li>
1448 <dt><strong>atan2</strong>
1450 <dd>
1451 <p>Due to issues with various CPUs, math libraries, compilers, and standards,
1452 results for <a href="#item_atan2"><code>atan2()</code></a> may vary depending on any combination of the above.
1453 Perl attempts to conform to the Open Group/IEEE standards for the results
1454 returned from <a href="#item_atan2"><code>atan2()</code></a>, but cannot force the issue if the system Perl is
1455 run on does not allow it. (Tru64, HP-UX 10.20)</p>
1456 </dd>
1457 <dd>
1458 <p>The current version of the standards for <a href="#item_atan2"><code>atan2()</code></a> is available at
1459 <a href="http://www.opengroup.org/onlinepubs/009695399/functions/atan2.html">http://www.opengroup.org/onlinepubs/009695399/functions/atan2.html</a>.</p>
1460 </dd>
1461 </li>
1462 <dt><strong><a name="item_binmode">binmode</a></strong>
1464 <dd>
1465 <p>Meaningless. (Mac&nbsp;OS, RISC&nbsp;OS)</p>
1466 </dd>
1467 <dd>
1468 <p>Reopens file and restores pointer; if function fails, underlying
1469 filehandle may be closed, or pointer may be in a different position.
1470 (VMS)</p>
1471 </dd>
1472 <dd>
1473 <p>The value returned by <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_tell"><code>tell</code></a> may be affected after the call, and
1474 the filehandle may be flushed. (Win32)</p>
1475 </dd>
1476 </li>
1477 <dt><strong><a name="item_chmod">chmod</a></strong>
1479 <dd>
1480 <p>Only limited meaning. Disabling/enabling write permission is mapped to
1481 locking/unlocking the file. (Mac&nbsp;OS)</p>
1482 </dd>
1483 <dd>
1484 <p>Only good for changing ``owner'' read-write access, ``group'', and ``other''
1485 bits are meaningless. (Win32)</p>
1486 </dd>
1487 <dd>
1488 <p>Only good for changing ``owner'' and ``other'' read-write access. (RISC&nbsp;OS)</p>
1489 </dd>
1490 <dd>
1491 <p>Access permissions are mapped onto VOS access-control list changes. (VOS)</p>
1492 </dd>
1493 <dd>
1494 <p>The actual permissions set depend on the value of the <code>CYGWIN</code>
1495 in the SYSTEM environment settings. (Cygwin)</p>
1496 </dd>
1497 </li>
1498 <dt><strong><a name="item_chown">chown</a></strong>
1500 <dd>
1501 <p>Not implemented. (Mac&nbsp;OS, Win32, Plan&nbsp;9, RISC&nbsp;OS, VOS)</p>
1502 </dd>
1503 <dd>
1504 <p>Does nothing, but won't fail. (Win32)</p>
1505 </dd>
1506 </li>
1507 <dt><strong><a name="item_chroot">chroot</a></strong>
1509 <dd>
1510 <p>Not implemented. (Mac&nbsp;OS, Win32, VMS, Plan&nbsp;9, RISC&nbsp;OS, VOS, VM/ESA)</p>
1511 </dd>
1512 </li>
1513 <dt><strong><a name="item_crypt">crypt</a></strong>
1515 <dd>
1516 <p>May not be available if library or source was not provided when building
1517 perl. (Win32)</p>
1518 </dd>
1519 <dd>
1520 <p>Not implemented. (VOS)</p>
1521 </dd>
1522 </li>
1523 <dt><strong><a name="item_dbmclose">dbmclose</a></strong>
1525 <dd>
1526 <p>Not implemented. (VMS, Plan&nbsp;9, VOS)</p>
1527 </dd>
1528 </li>
1529 <dt><strong><a name="item_dbmopen">dbmopen</a></strong>
1531 <dd>
1532 <p>Not implemented. (VMS, Plan&nbsp;9, VOS)</p>
1533 </dd>
1534 </li>
1535 <dt><strong><a name="item_dump">dump</a></strong>
1537 <dd>
1538 <p>Not useful. (Mac&nbsp;OS, RISC&nbsp;OS)</p>
1539 </dd>
1540 <dd>
1541 <p>Not implemented. (Win32)</p>
1542 </dd>
1543 <dd>
1544 <p>Invokes VMS debugger. (VMS)</p>
1545 </dd>
1546 </li>
1547 <dt><strong><a name="item_exec">exec</a></strong>
1549 <dd>
1550 <p>Not implemented. (Mac&nbsp;OS)</p>
1551 </dd>
1552 <dd>
1553 <p>Implemented via Spawn. (VM/ESA)</p>
1554 </dd>
1555 <dd>
1556 <p>Does not automatically flush output handles on some platforms.
1557 (SunOS, Solaris, HP-UX)</p>
1558 </dd>
1559 </li>
1560 <dt><strong><a name="item_exit">exit</a></strong>
1562 <dd>
1563 <p>Emulates UNIX <a href="#item_exit"><code>exit()</code></a> (which considers <a href="#item_exit"><code>exit 1</code></a> to indicate an error) by
1564 mapping the <code>1</code> to SS$_ABORT (<code>44</code>). This behavior may be overridden
1565 with the pragma <code>use vmsish 'exit'</code>. As with the CRTL's <a href="#item_exit"><code>exit()</code></a>
1566 function, <a href="#item_exit"><code>exit 0</code></a> is also mapped to an exit status of SS$_NORMAL
1567 (<code>1</code>); this mapping cannot be overridden. Any other argument to <a href="#item_exit"><code>exit()</code></a>
1568 is used directly as Perl's exit status. (VMS)</p>
1569 </dd>
1570 </li>
1571 <dt><strong><a name="item_fcntl">fcntl</a></strong>
1573 <dd>
1574 <p>Not implemented. (Win32, VMS)</p>
1575 </dd>
1576 </li>
1577 <dt><strong><a name="item_flock">flock</a></strong>
1579 <dd>
1580 <p>Not implemented (Mac&nbsp;OS, VMS, RISC&nbsp;OS, VOS).</p>
1581 </dd>
1582 <dd>
1583 <p>Available only on Windows NT (not on Windows 95). (Win32)</p>
1584 </dd>
1585 </li>
1586 <dt><strong><a name="item_fork">fork</a></strong>
1588 <dd>
1589 <p>Not implemented. (Mac&nbsp;OS, AmigaOS, RISC&nbsp;OS, VOS, VM/ESA, VMS)</p>
1590 </dd>
1591 <dd>
1592 <p>Emulated using multiple interpreters. See <a href="file://C|\msysgit\mingw\html/pod/perlfork.html">the perlfork manpage</a>. (Win32)</p>
1593 </dd>
1594 <dd>
1595 <p>Does not automatically flush output handles on some platforms.
1596 (SunOS, Solaris, HP-UX)</p>
1597 </dd>
1598 </li>
1599 <dt><strong><a name="item_getlogin">getlogin</a></strong>
1601 <dd>
1602 <p>Not implemented. (Mac&nbsp;OS, RISC&nbsp;OS)</p>
1603 </dd>
1604 </li>
1605 <dt><strong><a name="item_getpgrp">getpgrp</a></strong>
1607 <dd>
1608 <p>Not implemented. (Mac&nbsp;OS, Win32, VMS, RISC&nbsp;OS, VOS)</p>
1609 </dd>
1610 </li>
1611 <dt><strong><a name="item_getppid">getppid</a></strong>
1613 <dd>
1614 <p>Not implemented. (Mac&nbsp;OS, Win32, RISC&nbsp;OS)</p>
1615 </dd>
1616 </li>
1617 <dt><strong><a name="item_getpriority">getpriority</a></strong>
1619 <dd>
1620 <p>Not implemented. (Mac&nbsp;OS, Win32, VMS, RISC&nbsp;OS, VOS, VM/ESA)</p>
1621 </dd>
1622 </li>
1623 <dt><strong><a name="item_getpwnam">getpwnam</a></strong>
1625 <dd>
1626 <p>Not implemented. (Mac&nbsp;OS, Win32)</p>
1627 </dd>
1628 <dd>
1629 <p>Not useful. (RISC&nbsp;OS)</p>
1630 </dd>
1631 </li>
1632 <dt><strong><a name="item_getgrnam">getgrnam</a></strong>
1634 <dd>
1635 <p>Not implemented. (Mac&nbsp;OS, Win32, VMS, RISC&nbsp;OS)</p>
1636 </dd>
1637 </li>
1638 <dt><strong><a name="item_getnetbyname">getnetbyname</a></strong>
1640 <dd>
1641 <p>Not implemented. (Mac&nbsp;OS, Win32, Plan&nbsp;9)</p>
1642 </dd>
1643 </li>
1644 <dt><strong><a name="item_getpwuid">getpwuid</a></strong>
1646 <dd>
1647 <p>Not implemented. (Mac&nbsp;OS, Win32)</p>
1648 </dd>
1649 <dd>
1650 <p>Not useful. (RISC&nbsp;OS)</p>
1651 </dd>
1652 </li>
1653 <dt><strong><a name="item_getgrgid">getgrgid</a></strong>
1655 <dd>
1656 <p>Not implemented. (Mac&nbsp;OS, Win32, VMS, RISC&nbsp;OS)</p>
1657 </dd>
1658 </li>
1659 <dt><strong><a name="item_getnetbyaddr">getnetbyaddr</a></strong>
1661 <dd>
1662 <p>Not implemented. (Mac&nbsp;OS, Win32, Plan&nbsp;9)</p>
1663 </dd>
1664 </li>
1665 <dt><strong><a name="item_getprotobynumber">getprotobynumber</a></strong>
1667 <dd>
1668 <p>Not implemented. (Mac&nbsp;OS)</p>
1669 </dd>
1670 </li>
1671 <dt><strong><a name="item_getservbyport">getservbyport</a></strong>
1673 <dd>
1674 <p>Not implemented. (Mac&nbsp;OS)</p>
1675 </dd>
1676 </li>
1677 <dt><strong><a name="item_getpwent">getpwent</a></strong>
1679 <dd>
1680 <p>Not implemented. (Mac&nbsp;OS, Win32, VM/ESA)</p>
1681 </dd>
1682 </li>
1683 <dt><strong><a name="item_getgrent">getgrent</a></strong>
1685 <dd>
1686 <p>Not implemented. (Mac&nbsp;OS, Win32, VMS, VM/ESA)</p>
1687 </dd>
1688 </li>
1689 <dt><strong><a name="item_gethostbyname">gethostbyname</a></strong>
1691 <dd>
1692 <p><a href="#item_gethostbyname"><code>gethostbyname('localhost')</code></a> does not work everywhere: you may have
1693 to use <a href="#item_gethostbyname"><code>gethostbyname('127.0.0.1')</code></a>. (Mac&nbsp;OS, Irix&nbsp;5)</p>
1694 </dd>
1695 </li>
1696 <dt><strong><a name="item_gethostent">gethostent</a></strong>
1698 <dd>
1699 <p>Not implemented. (Mac&nbsp;OS, Win32)</p>
1700 </dd>
1701 </li>
1702 <dt><strong><a name="item_getnetent">getnetent</a></strong>
1704 <dd>
1705 <p>Not implemented. (Mac&nbsp;OS, Win32, Plan&nbsp;9)</p>
1706 </dd>
1707 </li>
1708 <dt><strong><a name="item_getprotoent">getprotoent</a></strong>
1710 <dd>
1711 <p>Not implemented. (Mac&nbsp;OS, Win32, Plan&nbsp;9)</p>
1712 </dd>
1713 </li>
1714 <dt><strong><a name="item_getservent">getservent</a></strong>
1716 <dd>
1717 <p>Not implemented. (Win32, Plan&nbsp;9)</p>
1718 </dd>
1719 </li>
1720 <dt><strong><a name="item_sethostent">sethostent</a></strong>
1722 <dd>
1723 <p>Not implemented. (Mac&nbsp;OS, Win32, Plan&nbsp;9, RISC&nbsp;OS)</p>
1724 </dd>
1725 </li>
1726 <dt><strong><a name="item_setnetent">setnetent</a></strong>
1728 <dd>
1729 <p>Not implemented. (Mac&nbsp;OS, Win32, Plan&nbsp;9, RISC&nbsp;OS)</p>
1730 </dd>
1731 </li>
1732 <dt><strong><a name="item_setprotoent">setprotoent</a></strong>
1734 <dd>
1735 <p>Not implemented. (Mac&nbsp;OS, Win32, Plan&nbsp;9, RISC&nbsp;OS)</p>
1736 </dd>
1737 </li>
1738 <dt><strong><a name="item_setservent">setservent</a></strong>
1740 <dd>
1741 <p>Not implemented. (Plan&nbsp;9, Win32, RISC&nbsp;OS)</p>
1742 </dd>
1743 </li>
1744 <dt><strong><a name="item_endpwent">endpwent</a></strong>
1746 <dd>
1747 <p>Not implemented. (Mac&nbsp;OS, MPE/iX, VM/ESA, Win32)</p>
1748 </dd>
1749 </li>
1750 <dt><strong><a name="item_endgrent">endgrent</a></strong>
1752 <dd>
1753 <p>Not implemented. (Mac&nbsp;OS, MPE/iX, RISC&nbsp;OS, VM/ESA, VMS, Win32)</p>
1754 </dd>
1755 </li>
1756 <dt><strong><a name="item_endhostent">endhostent</a></strong>
1758 <dd>
1759 <p>Not implemented. (Mac&nbsp;OS, Win32)</p>
1760 </dd>
1761 </li>
1762 <dt><strong><a name="item_endnetent">endnetent</a></strong>
1764 <dd>
1765 <p>Not implemented. (Mac&nbsp;OS, Win32, Plan&nbsp;9)</p>
1766 </dd>
1767 </li>
1768 <dt><strong><a name="item_endprotoent">endprotoent</a></strong>
1770 <dd>
1771 <p>Not implemented. (Mac&nbsp;OS, Win32, Plan&nbsp;9)</p>
1772 </dd>
1773 </li>
1774 <dt><strong><a name="item_endservent">endservent</a></strong>
1776 <dd>
1777 <p>Not implemented. (Plan&nbsp;9, Win32)</p>
1778 </dd>
1779 </li>
1780 <dt><strong><a name="item_getsockopt">getsockopt SOCKET,LEVEL,OPTNAME</a></strong>
1782 <dd>
1783 <p>Not implemented. (Plan&nbsp;9)</p>
1784 </dd>
1785 </li>
1786 <dt><strong><a name="item_glob">glob</a></strong>
1788 <dd>
1789 <p>This operator is implemented via the File::Glob extension on most
1790 platforms. See <a href="file://C|\msysgit\mingw\html/lib/File/Glob.html">the File::Glob manpage</a> for portability information.</p>
1791 </dd>
1792 </li>
1793 <dt><strong><a name="item_gmtime">gmtime</a></strong>
1795 <dd>
1796 <p>Same portability caveats as <a href="file://C|\msysgit\mingw\html/lib/Time/localtime.html">the localtime manpage</a>.</p>
1797 </dd>
1798 </li>
1799 <dt><strong><a name="item_ioctl">ioctl FILEHANDLE,FUNCTION,SCALAR</a></strong>
1801 <dd>
1802 <p>Not implemented. (VMS)</p>
1803 </dd>
1804 <dd>
1805 <p>Available only for socket handles, and it does what the <code>ioctlsocket()</code> call
1806 in the Winsock API does. (Win32)</p>
1807 </dd>
1808 <dd>
1809 <p>Available only for socket handles. (RISC&nbsp;OS)</p>
1810 </dd>
1811 </li>
1812 <dt><strong><a name="item_kill">kill</a></strong>
1814 <dd>
1815 <p><a href="#item_kill"><code>kill(0, LIST)</code></a> is implemented for the sake of taint checking;
1816 use with other signals is unimplemented. (Mac&nbsp;OS)</p>
1817 </dd>
1818 <dd>
1819 <p>Not implemented, hence not useful for taint checking. (RISC&nbsp;OS)</p>
1820 </dd>
1821 <dd>
1822 <p><a href="#item_kill"><code>kill()</code></a> doesn't have the semantics of <code>raise()</code>, i.e. it doesn't send
1823 a signal to the identified process like it does on Unix platforms.
1824 Instead <a href="#item_kill"><code>kill($sig, $pid)</code></a> terminates the process identified by $pid,
1825 and makes it exit immediately with exit status $sig. As in Unix, if
1826 $sig is 0 and the specified process exists, it returns true without
1827 actually terminating it. (Win32)</p>
1828 </dd>
1829 </li>
1830 <dt><strong><a name="item_link">link</a></strong>
1832 <dd>
1833 <p>Not implemented. (Mac&nbsp;OS, MPE/iX, VMS, RISC&nbsp;OS)</p>
1834 </dd>
1835 <dd>
1836 <p>Link count not updated because hard links are not quite that hard
1837 (They are sort of half-way between hard and soft links). (AmigaOS)</p>
1838 </dd>
1839 <dd>
1840 <p>Hard links are implemented on Win32 (Windows NT and Windows 2000)
1841 under NTFS only.</p>
1842 </dd>
1843 </li>
1844 <dt><strong><a name="item_localtime">localtime</a></strong>
1846 <dd>
1847 <p>Because Perl currently relies on the native standard C <a href="#item_localtime"><code>localtime()</code></a>
1848 function, it is only safe to use times between 0 and (2**31)-1. Times
1849 outside this range may result in unexpected behavior depending on your
1850 operating system's implementation of localtime().</p>
1851 </dd>
1852 </li>
1853 <dt><strong><a name="item_lstat">lstat</a></strong>
1855 <dd>
1856 <p>Not implemented. (VMS, RISC&nbsp;OS)</p>
1857 </dd>
1858 <dd>
1859 <p>Return values (especially for device and inode) may be bogus. (Win32)</p>
1860 </dd>
1861 </li>
1862 <dt><strong><a name="item_msgctl">msgctl</a></strong>
1864 <dt><strong><a name="item_msgget">msgget</a></strong>
1866 <dt><strong><a name="item_msgsnd">msgsnd</a></strong>
1868 <dt><strong><a name="item_msgrcv">msgrcv</a></strong>
1870 <dd>
1871 <p>Not implemented. (Mac&nbsp;OS, Win32, VMS, Plan&nbsp;9, RISC&nbsp;OS, VOS)</p>
1872 </dd>
1873 </li>
1874 <dt><strong><a name="item_open">open</a></strong>
1876 <dd>
1877 <p>The <code>|</code> variants are supported only if ToolServer is installed.
1878 (Mac&nbsp;OS)</p>
1879 </dd>
1880 <dd>
1881 <p>open to <code>|-</code> and <code>-|</code> are unsupported. (Mac&nbsp;OS, Win32, RISC&nbsp;OS)</p>
1882 </dd>
1883 <dd>
1884 <p>Opening a process does not automatically flush output handles on some
1885 platforms. (SunOS, Solaris, HP-UX)</p>
1886 </dd>
1887 </li>
1888 <dt><strong><a name="item_pipe">pipe</a></strong>
1890 <dd>
1891 <p>Very limited functionality. (MiNT)</p>
1892 </dd>
1893 </li>
1894 <dt><strong><a name="item_readlink">readlink</a></strong>
1896 <dd>
1897 <p>Not implemented. (Win32, VMS, RISC&nbsp;OS)</p>
1898 </dd>
1899 </li>
1900 <dt><strong><a name="item_rename">rename</a></strong>
1902 <dd>
1903 <p>Can't move directories between directories on different logical volumes. (Win32)</p>
1904 </dd>
1905 </li>
1906 <dt><strong><a name="item_select">select</a></strong>
1908 <dd>
1909 <p>Only implemented on sockets. (Win32, VMS)</p>
1910 </dd>
1911 <dd>
1912 <p>Only reliable on sockets. (RISC&nbsp;OS)</p>
1913 </dd>
1914 <dd>
1915 <p>Note that the <a href="#item_select"><code>select FILEHANDLE</code></a> form is generally portable.</p>
1916 </dd>
1917 </li>
1918 <dt><strong><a name="item_semctl">semctl</a></strong>
1920 <dt><strong><a name="item_semget">semget</a></strong>
1922 <dt><strong><a name="item_semop">semop</a></strong>
1924 <dd>
1925 <p>Not implemented. (Mac&nbsp;OS, Win32, VMS, RISC&nbsp;OS, VOS)</p>
1926 </dd>
1927 </li>
1928 <dt><strong><a name="item_setgrent">setgrent</a></strong>
1930 <dd>
1931 <p>Not implemented. (Mac&nbsp;OS, MPE/iX, VMS, Win32, RISC&nbsp;OS)</p>
1932 </dd>
1933 </li>
1934 <dt><strong><a name="item_setpgrp">setpgrp</a></strong>
1936 <dd>
1937 <p>Not implemented. (Mac&nbsp;OS, Win32, VMS, RISC&nbsp;OS, VOS)</p>
1938 </dd>
1939 </li>
1940 <dt><strong><a name="item_setpriority">setpriority</a></strong>
1942 <dd>
1943 <p>Not implemented. (Mac&nbsp;OS, Win32, VMS, RISC&nbsp;OS, VOS)</p>
1944 </dd>
1945 </li>
1946 <dt><strong><a name="item_setpwent">setpwent</a></strong>
1948 <dd>
1949 <p>Not implemented. (Mac&nbsp;OS, MPE/iX, Win32, RISC&nbsp;OS)</p>
1950 </dd>
1951 </li>
1952 <dt><strong><a name="item_setsockopt">setsockopt</a></strong>
1954 <dd>
1955 <p>Not implemented. (Plan&nbsp;9)</p>
1956 </dd>
1957 </li>
1958 <dt><strong><a name="item_shmctl">shmctl</a></strong>
1960 <dt><strong><a name="item_shmget">shmget</a></strong>
1962 <dt><strong><a name="item_shmread">shmread</a></strong>
1964 <dt><strong><a name="item_shmwrite">shmwrite</a></strong>
1966 <dd>
1967 <p>Not implemented. (Mac&nbsp;OS, Win32, VMS, RISC&nbsp;OS, VOS)</p>
1968 </dd>
1969 </li>
1970 <dt><strong><a name="item_sockatmark">sockatmark</a></strong>
1972 <dd>
1973 <p>A relatively recent addition to socket functions, may not
1974 be implemented even in UNIX platforms.</p>
1975 </dd>
1976 </li>
1977 <dt><strong><a name="item_socketpair">socketpair</a></strong>
1979 <dd>
1980 <p>Not implemented. (Win32, VMS, RISC&nbsp;OS, VOS, VM/ESA)</p>
1981 </dd>
1982 </li>
1983 <dt><strong><a name="item_stat">stat</a></strong>
1985 <dd>
1986 <p>Platforms that do not have rdev, blksize, or blocks will return these
1987 as '', so numeric comparison or manipulation of these fields may cause
1988 'not numeric' warnings.</p>
1989 </dd>
1990 <dd>
1991 <p>mtime and atime are the same thing, and ctime is creation time instead of
1992 inode change time. (Mac&nbsp;OS).</p>
1993 </dd>
1994 <dd>
1995 <p>ctime not supported on UFS (Mac&nbsp;OS&nbsp;X).</p>
1996 </dd>
1997 <dd>
1998 <p>ctime is creation time instead of inode change time (Win32).</p>
1999 </dd>
2000 <dd>
2001 <p>device and inode are not meaningful. (Win32)</p>
2002 </dd>
2003 <dd>
2004 <p>device and inode are not necessarily reliable. (VMS)</p>
2005 </dd>
2006 <dd>
2007 <p>mtime, atime and ctime all return the last modification time. Device and
2008 inode are not necessarily reliable. (RISC&nbsp;OS)</p>
2009 </dd>
2010 <dd>
2011 <p>dev, rdev, blksize, and blocks are not available. inode is not
2012 meaningful and will differ between stat calls on the same file. (os2)</p>
2013 </dd>
2014 <dd>
2015 <p>some versions of cygwin when doing a <a href="#item_stat"><code>stat(``foo'')</code></a> and if not finding it
2016 may then attempt to <a href="#item_stat"><code>stat(``foo.exe'')</code></a> (Cygwin)</p>
2017 </dd>
2018 </li>
2019 <dt><strong><a name="item_symlink">symlink</a></strong>
2021 <dd>
2022 <p>Not implemented. (Win32, VMS, RISC&nbsp;OS)</p>
2023 </dd>
2024 </li>
2025 <dt><strong><a name="item_syscall">syscall</a></strong>
2027 <dd>
2028 <p>Not implemented. (Mac&nbsp;OS, Win32, VMS, RISC&nbsp;OS, VOS, VM/ESA)</p>
2029 </dd>
2030 </li>
2031 <dt><strong><a name="item_sysopen">sysopen</a></strong>
2033 <dd>
2034 <p>The traditional ``0'', ``1'', and ``2'' MODEs are implemented with different
2035 numeric values on some systems. The flags exported by <code>Fcntl</code>
2036 (O_RDONLY, O_WRONLY, O_RDWR) should work everywhere though. (Mac
2037 OS, OS/390, VM/ESA)</p>
2038 </dd>
2039 </li>
2040 <dt><strong><a name="item_system">system</a></strong>
2042 <dd>
2043 <p>In general, do not assume the UNIX/POSIX semantics that you can shift
2044 <a href="file://C|\msysgit\mingw\html/pod/perlvar.html#item__"><code>$?</code></a> right by eight to get the exit value, or that <a href="file://C|\msysgit\mingw\html/pod/perlvar.html#item__"><code>$? &amp; 127</code></a>
2045 would give you the number of the signal that terminated the program,
2046 or that <a href="file://C|\msysgit\mingw\html/pod/perlvar.html#item__"><code>$? &amp; 128</code></a> would test true if the program was terminated by a
2047 coredump. Instead, use the POSIX W*() interfaces: for example, use
2048 <code>WIFEXITED($?)</code> and <code>WEXITVALUE($?)</code> to test for a normal exit and the exit
2049 value, <code>WIFSIGNALED($?)</code> and <code>WTERMSIG($?)</code> for a signal exit and the
2050 signal. Core dumping is not a portable concept, so there's no portable
2051 way to test for that.</p>
2052 </dd>
2053 <dd>
2054 <p>Only implemented if ToolServer is installed. (Mac&nbsp;OS)</p>
2055 </dd>
2056 <dd>
2057 <p>As an optimization, may not call the command shell specified in
2058 <code>$ENV{PERL5SHELL}</code>. <a href="#item_system"><code>system(1, @args)</code></a> spawns an external
2059 process and immediately returns its process designator, without
2060 waiting for it to terminate. Return value may be used subsequently
2061 in <a href="#item_wait"><code>wait</code></a> or <a href="#item_waitpid"><code>waitpid</code></a>. Failure to <code>spawn()</code> a subprocess is indicated
2062 by setting $? to ``255 &lt;&lt; 8''. <a href="file://C|\msysgit\mingw\html/pod/perlvar.html#item__"><code>$?</code></a> is set in a way compatible with
2063 Unix (i.e. the exitstatus of the subprocess is obtained by ``$? &gt;&gt; 8'',
2064 as described in the documentation). (Win32)</p>
2065 </dd>
2066 <dd>
2067 <p>There is no shell to process metacharacters, and the native standard is
2068 to pass a command line terminated by ``\n'' ``\r'' or ``\0'' to the spawned
2069 program. Redirection such as <code>&gt; foo</code> is performed (if at all) by
2070 the run time library of the spawned program. <a href="#item_system"><code>system</code></a> <em>list</em> will call
2071 the Unix emulation library's <a href="#item_exec"><code>exec</code></a> emulation, which attempts to provide
2072 emulation of the stdin, stdout, stderr in force in the parent, providing
2073 the child program uses a compatible version of the emulation library.
2074 <em>scalar</em> will call the native command line direct and no such emulation
2075 of a child Unix program will exists. Mileage <strong>will</strong> vary. (RISC&nbsp;OS)</p>
2076 </dd>
2077 <dd>
2078 <p>Far from being POSIX compliant. Because there may be no underlying
2079 /bin/sh tries to work around the problem by forking and execing the
2080 first token in its argument string. Handles basic redirection
2081 (``&lt;'' or ``&gt;'') on its own behalf. (MiNT)</p>
2082 </dd>
2083 <dd>
2084 <p>Does not automatically flush output handles on some platforms.
2085 (SunOS, Solaris, HP-UX)</p>
2086 </dd>
2087 <dd>
2088 <p>The return value is POSIX-like (shifted up by 8 bits), which only allows
2089 room for a made-up value derived from the severity bits of the native
2090 32-bit condition code (unless overridden by <code>use vmsish 'status'</code>).
2091 For more details see <a href="file://C|\msysgit\mingw\html/pod/perlvms.html#_">$? in the perlvms manpage</a>. (VMS)</p>
2092 </dd>
2093 </li>
2094 <dt><strong><a name="item_times">times</a></strong>
2096 <dd>
2097 <p>Only the first entry returned is nonzero. (Mac&nbsp;OS)</p>
2098 </dd>
2099 <dd>
2100 <p>``cumulative'' times will be bogus. On anything other than Windows NT
2101 or Windows 2000, ``system'' time will be bogus, and ``user'' time is
2102 actually the time returned by the <code>clock()</code> function in the C runtime
2103 library. (Win32)</p>
2104 </dd>
2105 <dd>
2106 <p>Not useful. (RISC&nbsp;OS)</p>
2107 </dd>
2108 </li>
2109 <dt><strong><a name="item_truncate">truncate</a></strong>
2111 <dd>
2112 <p>Not implemented. (Older versions of VMS)</p>
2113 </dd>
2114 <dd>
2115 <p>Truncation to zero-length only. (VOS)</p>
2116 </dd>
2117 <dd>
2118 <p>If a FILEHANDLE is supplied, it must be writable and opened in append
2119 mode (i.e., use <a href="#item_open"><code>open(FH, '&gt;&gt;filename')</code></a>
2120 or <a href="#item_sysopen"><code>sysopen(FH,...,O_APPEND|O_RDWR)</code></a>. If a filename is supplied, it
2121 should not be held open elsewhere. (Win32)</p>
2122 </dd>
2123 </li>
2124 <dt><strong><a name="item_umask">umask</a></strong>
2126 <dd>
2127 <p>Returns undef where unavailable, as of version 5.005.</p>
2128 </dd>
2129 <dd>
2130 <p><a href="#item_umask"><code>umask</code></a> works but the correct permissions are set only when the file
2131 is finally closed. (AmigaOS)</p>
2132 </dd>
2133 </li>
2134 <dt><strong><a name="item_utime">utime</a></strong>
2136 <dd>
2137 <p>Only the modification time is updated. (BeOS, Mac&nbsp;OS, VMS, RISC&nbsp;OS)</p>
2138 </dd>
2139 <dd>
2140 <p>May not behave as expected. Behavior depends on the C runtime
2141 library's implementation of utime(), and the filesystem being
2142 used. The FAT filesystem typically does not support an ``access
2143 time'' field, and it may limit timestamps to a granularity of
2144 two seconds. (Win32)</p>
2145 </dd>
2146 </li>
2147 <dt><strong><a name="item_wait">wait</a></strong>
2149 <dt><strong><a name="item_waitpid">waitpid</a></strong>
2151 <dd>
2152 <p>Not implemented. (Mac&nbsp;OS, VOS)</p>
2153 </dd>
2154 <dd>
2155 <p>Can only be applied to process handles returned for processes spawned
2156 using <a href="#item_system"><code>system(1, ...)</code></a> or pseudo processes created with <a href="#item_fork"><code>fork()</code></a>. (Win32)</p>
2157 </dd>
2158 <dd>
2159 <p>Not useful. (RISC&nbsp;OS)</p>
2160 </dd>
2161 </li>
2162 </dl>
2164 </p>
2165 <hr />
2166 <h1><a name="supported_platforms">Supported Platforms</a></h1>
2167 <p>As of September 2003 (the Perl release 5.8.1), the following platforms
2168 are able to build Perl from the standard source code distribution
2169 available at <a href="http://www.cpan.org/src/index.html">http://www.cpan.org/src/index.html</a></p>
2170 <pre>
2172 BeOS
2173 BSD/OS (BSDi)
2174 Cygwin
2175 DG/UX
2176 DOS DJGPP 1)
2177 DYNIX/ptx
2178 EPOC R5
2179 FreeBSD
2180 HI-UXMPP (Hitachi) (5.8.0 worked but we didn't know it)
2181 HP-UX
2182 IRIX
2183 Linux
2184 LynxOS
2185 Mac OS Classic
2186 Mac OS X (Darwin)
2187 MPE/iX
2188 NetBSD
2189 NetWare
2190 NonStop-UX
2191 ReliantUNIX (formerly SINIX)
2192 OpenBSD
2193 OpenVMS (formerly VMS)
2194 Open UNIX (Unixware) (since Perl 5.8.1/5.9.0)
2195 OS/2
2196 OS/400 (using the PASE) (since Perl 5.8.1/5.9.0)
2197 PowerUX
2198 POSIX-BC (formerly BS2000)
2200 Solaris
2201 SunOS 4
2202 SUPER-UX (NEC)
2203 SVR4
2204 Tru64 UNIX (formerly DEC OSF/1, Digital UNIX)
2205 UNICOS
2206 UNICOS/mk
2209 Win95/98/ME/2K/XP 2)
2210 WinCE
2211 z/OS (formerly OS/390)
2212 VM/ESA</pre>
2213 <pre>
2214 1) in DOS mode either the DOS or OS/2 ports can be used
2215 2) compilers: Borland, MinGW (GCC), VC6</pre>
2216 <p>The following platforms worked with the previous releases (5.6 and
2217 5.7), but we did not manage either to fix or to test these in time
2218 for the 5.8.1 release. There is a very good chance that many of these
2219 will work fine with the 5.8.1.</p>
2220 <pre>
2221 DomainOS
2222 Hurd
2223 MachTen
2224 PowerMAX
2225 SCO SV
2226 Unixware
2227 Windows 3.1</pre>
2228 <p>Known to be broken for 5.8.0 and 5.8.1 (but 5.6.1 and 5.7.2 can be used):</p>
2229 <pre>
2230 AmigaOS</pre>
2231 <p>The following platforms have been known to build Perl from source in
2232 the past (5.005_03 and earlier), but we haven't been able to verify
2233 their status for the current release, either because the
2234 hardware/software platforms are rare or because we don't have an
2235 active champion on these platforms--or both. They used to work,
2236 though, so go ahead and try compiling them, and let <a href="mailto:perlbug@perl.org">perlbug@perl.org</a>
2237 of any trouble.</p>
2238 <pre>
2240 A/UX
2241 ConvexOS
2242 CX/UX
2243 DC/OSx
2244 DDE SMES
2245 DOS EMX
2246 Dynix
2247 EP/IX
2248 ESIX
2250 GENIX
2251 Greenhills
2253 MachTen 68k
2254 MiNT
2256 NEWS-OS
2257 NextSTEP
2258 OpenSTEP
2259 Opus
2260 Plan 9
2261 RISC/os
2262 SCO ODT/OSR
2263 Stellar
2264 SVR2
2265 TI1500
2266 TitanOS
2267 Ultrix
2268 Unisys Dynix</pre>
2269 <p>The following platforms have their own source code distributions and
2270 binaries available via <a href="http://www.cpan.org/ports/">http://www.cpan.org/ports/</a></p>
2271 <pre>
2272 Perl release</pre>
2273 <pre>
2274 OS/400 (ILE) 5.005_02
2275 Tandem Guardian 5.004</pre>
2276 <p>The following platforms have only binaries available via
2277 <a href="http://www.cpan.org/ports/index.html">http://www.cpan.org/ports/index.html</a> :</p>
2278 <pre>
2279 Perl release</pre>
2280 <pre>
2281 Acorn RISCOS 5.005_02
2282 AOS 5.002
2283 LynxOS 5.004_02</pre>
2284 <p>Although we do suggest that you always build your own Perl from
2285 the source code, both for maximal configurability and for security,
2286 in case you are in a hurry you can check
2287 <a href="http://www.cpan.org/ports/index.html">http://www.cpan.org/ports/index.html</a> for binary distributions.</p>
2289 </p>
2290 <hr />
2291 <h1><a name="see_also">SEE ALSO</a></h1>
2292 <p><a href="file://C|\msysgit\mingw\html/pod/perlaix.html">the perlaix manpage</a>, <a href="file://C|\msysgit\mingw\html/pod/perlamiga.html">the perlamiga manpage</a>, <a href="file://C|\msysgit\mingw\html/pod/perlapollo.html">the perlapollo manpage</a>, <a href="file://C|\msysgit\mingw\html/pod/perlbeos.html">the perlbeos manpage</a>, <a href="file://C|\msysgit\mingw\html/pod/perlbs2000.html">the perlbs2000 manpage</a>,
2293 <a href="file://C|\msysgit\mingw\html/pod/perlce.html">the perlce manpage</a>, <a href="file://C|\msysgit\mingw\html/pod/perlcygwin.html">the perlcygwin manpage</a>, <a href="file://C|\msysgit\mingw\html/pod/perldgux.html">the perldgux manpage</a>, <a href="file://C|\msysgit\mingw\html/pod/perldos.html">the perldos manpage</a>, <a href="file://C|\msysgit\mingw\html/pod/perlepoc.html">the perlepoc manpage</a>,
2294 <a href="file://C|\msysgit\mingw\html/pod/perlebcdic.html">the perlebcdic manpage</a>, <a href="file://C|\msysgit\mingw\html/pod/perlfreebsd.html">the perlfreebsd manpage</a>, <a href="file://C|\msysgit\mingw\html/pod/perlhurd.html">the perlhurd manpage</a>, <a href="file://C|\msysgit\mingw\html/pod/perlhpux.html">the perlhpux manpage</a>, <a href="file://C|\msysgit\mingw\html/pod/perlirix.html">the perlirix manpage</a>,
2295 <a href="file://C|\msysgit\mingw\html/pod/perlmachten.html">the perlmachten manpage</a>, <a href="file://C|\msysgit\mingw\html/pod/perlmacos.html">the perlmacos manpage</a>, <a href="file://C|\msysgit\mingw\html/pod/perlmacosx.html">the perlmacosx manpage</a>, <a href="file://C|\msysgit\mingw\html/pod/perlmint.html">the perlmint manpage</a>, <a href="file://C|\msysgit\mingw\html/pod/perlmpeix.html">the perlmpeix manpage</a>,
2296 <a href="file://C|\msysgit\mingw\html/pod/perlnetware.html">the perlnetware manpage</a>, <a href="file://C|\msysgit\mingw\html/pod/perlos2.html">the perlos2 manpage</a>, <a href="file://C|\msysgit\mingw\html/pod/perlos390.html">the perlos390 manpage</a>, <a href="file://C|\msysgit\mingw\html/pod/perlos400.html">the perlos400 manpage</a>,
2297 <a href="file://C|\msysgit\mingw\html/pod/perlplan9.html">the perlplan9 manpage</a>, <a href="file://C|\msysgit\mingw\html/pod/perlqnx.html">the perlqnx manpage</a>, <a href="file://C|\msysgit\mingw\html/pod/perlsolaris.html">the perlsolaris manpage</a>, <a href="file://C|\msysgit\mingw\html/pod/perltru64.html">the perltru64 manpage</a>,
2298 <a href="file://C|\msysgit\mingw\html/pod/perlunicode.html">the perlunicode manpage</a>, <a href="file://C|\msysgit\mingw\html/pod/perlvmesa.html">the perlvmesa manpage</a>, <a href="file://C|\msysgit\mingw\html/pod/perlvms.html">the perlvms manpage</a>, <a href="file://C|\msysgit\mingw\html/pod/perlvos.html">the perlvos manpage</a>,
2299 <a href="file://C|\msysgit\mingw\html/pod/perlwin32.html">the perlwin32 manpage</a>, and <a href="file://C|\msysgit\mingw\html/lib/Win32.html">the Win32 manpage</a>.</p>
2301 </p>
2302 <hr />
2303 <h1><a name="authors___contributors">AUTHORS / CONTRIBUTORS</a></h1>
2304 <p>Abigail &lt;<a href="mailto:abigail@foad.org">abigail@foad.org</a>&gt;,
2305 Charles Bailey &lt;<a href="mailto:bailey@newman.upenn.edu">bailey@newman.upenn.edu</a>&gt;,
2306 Graham Barr &lt;<a href="mailto:gbarr@pobox.com">gbarr@pobox.com</a>&gt;,
2307 Tom Christiansen &lt;<a href="mailto:tchrist@perl.com">tchrist@perl.com</a>&gt;,
2308 Nicholas Clark &lt;<a href="mailto:nick@ccl4.org">nick@ccl4.org</a>&gt;,
2309 Thomas Dorner &lt;<a href="mailto:Thomas.Dorner@start.de">Thomas.Dorner@start.de</a>&gt;,
2310 Andy Dougherty &lt;<a href="mailto:doughera@lafayette.edu">doughera@lafayette.edu</a>&gt;,
2311 Dominic Dunlop &lt;<a href="mailto:domo@computer.org">domo@computer.org</a>&gt;,
2312 Neale Ferguson &lt;<a href="mailto:neale@vma.tabnsw.com.au">neale@vma.tabnsw.com.au</a>&gt;,
2313 David J. Fiander &lt;<a href="mailto:davidf@mks.com">davidf@mks.com</a>&gt;,
2314 Paul Green &lt;<a href="mailto:Paul_Green@stratus.com">Paul_Green@stratus.com</a>&gt;,
2315 M.J.T. Guy &lt;<a href="mailto:mjtg@cam.ac.uk">mjtg@cam.ac.uk</a>&gt;,
2316 Jarkko Hietaniemi &lt;<a href="mailto:jhi@iki.fi">jhi@iki.fi</a>&gt;,
2317 Luther Huffman &lt;<a href="mailto:lutherh@stratcom.com">lutherh@stratcom.com</a>&gt;,
2318 Nick Ing-Simmons &lt;<a href="mailto:nick@ing-simmons.net">nick@ing-simmons.net</a>&gt;,
2319 Andreas J. K&ouml;nig &lt;<a href="mailto:a.koenig@mind.de">a.koenig@mind.de</a>&gt;,
2320 Markus Laker &lt;<a href="mailto:mlaker@contax.co.uk">mlaker@contax.co.uk</a>&gt;,
2321 Andrew M. Langmead &lt;<a href="mailto:aml@world.std.com">aml@world.std.com</a>&gt;,
2322 Larry Moore &lt;<a href="mailto:ljmoore@freespace.net">ljmoore@freespace.net</a>&gt;,
2323 Paul Moore &lt;<a href="mailto:Paul.Moore@uk.origin-it.com">Paul.Moore@uk.origin-it.com</a>&gt;,
2324 Chris Nandor &lt;<a href="mailto:pudge@pobox.com">pudge@pobox.com</a>&gt;,
2325 Matthias Neeracher &lt;<a href="mailto:neeracher@mac.com">neeracher@mac.com</a>&gt;,
2326 Philip Newton &lt;<a href="mailto:pne@cpan.org">pne@cpan.org</a>&gt;,
2327 Gary Ng &lt;<a href="mailto:71564.1743@CompuServe.COM">71564.1743@CompuServe.COM</a>&gt;,
2328 Tom Phoenix &lt;<a href="mailto:rootbeer@teleport.com">rootbeer@teleport.com</a>&gt;,
2329 Andr&eacute; Pirard &lt;<a href="mailto:A.Pirard@ulg.ac.be">A.Pirard@ulg.ac.be</a>&gt;,
2330 Peter Prymmer &lt;<a href="mailto:pvhp@forte.com">pvhp@forte.com</a>&gt;,
2331 Hugo van der Sanden &lt;<a href="mailto:hv@crypt0.demon.co.uk">hv@crypt0.demon.co.uk</a>&gt;,
2332 Gurusamy Sarathy &lt;<a href="mailto:gsar@activestate.com">gsar@activestate.com</a>&gt;,
2333 Paul J. Schinder &lt;<a href="mailto:schinder@pobox.com">schinder@pobox.com</a>&gt;,
2334 Michael G Schwern &lt;<a href="mailto:schwern@pobox.com">schwern@pobox.com</a>&gt;,
2335 Dan Sugalski &lt;<a href="mailto:dan@sidhe.org">dan@sidhe.org</a>&gt;,
2336 Nathan Torkington &lt;<a href="mailto:gnat@frii.com">gnat@frii.com</a>&gt;.</p>
2337 <table border="0" width="100%" cellspacing="0" cellpadding="3">
2338 <tr><td class="block" style="background-color: #cccccc" valign="middle">
2339 <big><strong><span class="block">&nbsp;perlport - Writing portable Perl</span></strong></big>
2340 </td></tr>
2341 </table>
2343 </body>
2345 </html>