Debian Codegraph @

upstream/opensuse-tumbleweed/man1/perlport.1

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