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