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