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