This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
README.os2 update
[perl5.git] / pod / perlport.pod
CommitLineData
e41182b5
GS
1=head1 NAME
2
3perlport - Writing portable Perl
4
5
6=head1 DESCRIPTION
7
8Perl runs on a variety of operating systems. While most of them share
9a lot in common, they also have their own very particular and unique
10features.
11
12This document is meant to help you to find out what constitutes portable
13perl code, so that once you have made your decision to write portably,
14you know where the lines are drawn, and you can stay within them.
15
16There is a tradeoff between taking full advantage of B<a> particular type
17of computer, and taking advantage of a full B<range> of them. Naturally,
18as you make your range bigger (and thus more diverse), the common denominators
19drop, and you are left with fewer areas of common ground in which
20you can operate to accomplish a particular task. Thus, when you begin
21attacking a problem, it is important to consider which part of the tradeoff
22curve you want to operate under. Specifically, whether it is important to
23you that the task that you are coding needs the full generality of being
24portable, or if it is sufficient to just get the job done. This is the
25hardest choice to be made. The rest is easy, because Perl provides lots
26of choices, whichever way you want to approach your problem.
27
28Looking at it another way, writing portable code is usually about willfully
29limiting your available choices. Naturally, it takes discipline to do that.
30
31Be aware of two important points:
32
33=over 4
34
35=item Not all Perl programs have to be portable
36
37There is no reason why you should not use Perl as a language to glue Unix
38tools together, or to prototype a Macintosh application, or to manage the
39Windows registry. If it makes no sense to aim for portability for one
40reason or another in a given program, then don't bother.
41
42=item The vast majority of Perl B<is> portable
43
44Don't be fooled into thinking that it is hard to create portable Perl
45code. It isn't. Perl tries its level-best to bridge the gaps between
46what's available on different platforms, and all the means available to
47use those features. Thus almost all Perl code runs on any machine
48without modification. But there I<are> some significant issues in
49writing portable code, and this document is entirely about those issues.
50
51=back
52
53Here's the general rule: When you approach a task that is commonly done
54using a whole range of platforms, think in terms of writing portable
55code. That way, you don't sacrifice much by way of the implementation
56choices you can avail yourself of, and at the same time you can give
57your users lots of platform choices. On the other hand, when you have to
58take advantage of some unique feature of a particular platform, as is
59often the case with systems programming (whether for Unix, Windows,
60S<Mac OS>, VMS, etc.), consider writing platform-specific code.
61
62When the code will run on only two or three operating systems, then you may
63only need to consider the differences of those particular systems. The
64important thing is to decide where the code will run, and to be deliberate
65in your decision.
66
67This information should not be considered complete; it includes possibly
b8099c3d 68transient information about idiosyncrasies of some of the ports, almost
e41182b5
GS
69all of which are in a state of constant evolution. Thus this material
70should be considered a perpetual work in progress
71(E<lt>IMG SRC="yellow_sign.gif" ALT="Under Construction"E<gt>).
72
73
74=head1 ISSUES
75
76=head2 Newlines
77
78In most operating systems, lines in files are separated with newlines.
79Just what is used as a newline may vary from OS to OS. Unix
80traditionally uses C<\012>, one kind of Windows I/O uses C<\015\012>,
81and S<Mac OS> uses C<\015>.
82
83Perl uses C<\n> to represent the "logical" newline, where what
84is logical may depend on the platform in use. In MacPerl, C<\n>
85always means C<\015>. In DOSish perls, C<\n> usually means C<\012>, but
86when accessing a file in "text" mode, STDIO translates it to (or from)
87C<\015\012>.
88
89Due to the "text" mode translation, DOSish perls have limitations
90of using C<seek> and C<tell> when a file is being accessed in "text"
91mode. Specifically, if you stick to C<seek>-ing to locations you got
92from C<tell> (and no others), you are usually free to use C<seek> and
93C<tell> even in "text" mode. In general, using C<seek> or C<tell> or
94other file operations that count bytes instead of characters, without
95considering the length of C<\n>, may be non-portable. If you use
96C<binmode> on a file, however, you can usually use C<seek> and C<tell>
97with arbitrary values quite safely.
98
99A common misconception in socket programming is that C<\n> eq C<\012>
100everywhere. When using protocols, such as common Internet protocols,
101C<\012> and C<\015> are called for specifically, and the values of
102the logical C<\n> and C<\r> (carriage return) are not reliable.
103
104 print SOCKET "Hi there, client!\r\n"; # WRONG
105 print SOCKET "Hi there, client!\015\012"; # RIGHT
106
107[NOTE: this does not necessarily apply to communications that are
108filtered by another program or module before sending to the socket; the
109the most popular EBCDIC webserver, for instance, accepts C<\r\n>,
110which translates those characters, along with all other
111characters in text streams, from EBCDIC to ASCII.]
112
113However, C<\015\012> (or C<\cM\cJ>, or C<\x0D\x0A>) can be tedious and
114unsightly, as well as confusing to those maintaining the code. As such,
115the C<Socket> module supplies the Right Thing for those who want it.
116
117 use Socket qw(:DEFAULT :crlf);
118 print SOCKET "Hi there, client!$CRLF" # RIGHT
119
120When reading I<from> a socket, remember that the default input record
121separator (C<$/>) is C<\n>, but code like this should recognize C<$/> as
122C<\012> or C<\015\012>:
123
124 while (<SOCKET>) {
125 # ...
126 }
127
128Better:
129
130 use Socket qw(:DEFAULT :crlf);
131 local($/) = LF; # not needed if $/ is already \012
132
133 while (<SOCKET>) {
134 s/$CR?$LF/\n/; # not sure if socket uses LF or CRLF, OK
135 # s/\015?\012/\n/; # same thing
136 }
137
138And this example is actually better than the previous one even for Unix
139platforms, because now any C<\015>'s (C<\cM>'s) are stripped out
140(and there was much rejoicing).
141
142
143=head2 File Paths
144
145Most platforms these days structure files in a hierarchical fashion.
146So, it is reasonably safe to assume that any platform supports the
147notion of a "path" to uniquely identify a file on the system. Just
148how that path is actually written, differs.
149
150While they are similar, file path specifications differ between Unix,
b8099c3d
CN
151Windows, S<Mac OS>, OS/2, VMS, S<RISC OS> and probably others. Unix,
152for example, is one of the few OSes that has the idea of a root directory.
153S<Mac OS> uses C<:> as a path separator instead of C</>. VMS, Windows, and
154OS/2 can work similarly to Unix with C</> as path separator, or in their own
155idiosyncratic ways. C<RISC OS> perl can emulate Unix filenames with C</>
156as path separator, or go native and use C<.> for path separator and C<:>
157to signal filing systems and disc names.
e41182b5
GS
158
159As with the newline problem above, there are modules that can help. The
160C<File::Spec> modules provide methods to do the Right Thing on whatever
161platform happens to be running the program.
162
163 use File::Spec;
164 chdir(File::Spec->updir()); # go up one directory
165 $file = File::Spec->catfile(
166 File::Spec->curdir(), 'temp', 'file.txt'
167 );
168 # on Unix and Win32, './temp/file.txt'
169 # on Mac OS, ':temp:file.txt'
170
171File::Spec is available in the standard distribution, as of version
1725.004_05.
173
174In general, production code should not have file paths hardcoded; making
175them user supplied or from a configuration file is better, keeping in mind
176that file path syntax varies on different machines.
177
178This is especially noticeable in scripts like Makefiles and test suites,
179which often assume C</> as a path separator for subdirectories.
180
181Also of use is C<File::Basename>, from the standard distribution, which
182splits a pathname into pieces (base filename, full path to directory,
183and file suffix).
184
185Remember not to count on the existence of system-specific files, like
186F</etc/resolv.conf>. If code does need to rely on such a file, include a
187description of the file and its format in the code's documentation, and
188make it easy for the user to override the default location of the file.
189
b8099c3d
CN
190Don't assume that a you can open a full pathname for input with
191C<open (FILE, $name)>, as some platforms can use characters such as C<E<lt>>
192which will perl C<open> will interpret and eat.
193
e41182b5
GS
194
195=head2 System Interaction
196
197Not all platforms provide for the notion of a command line, necessarily.
198These are usually platforms that rely on a Graphical User Interface (GUI)
199for user interaction. So a program requiring command lines might not work
200everywhere. But this is probably for the user of the program to deal
201with.
202
203Some platforms can't delete or rename files that are being held open by
204the system. Remember to C<close> files when you are done with them.
205Don't C<unlink> or C<rename> an open file. Don't C<tie> to or C<open> a
206file that is already tied to or opened; C<untie> or C<close> first.
207
208Don't count on a specific environment variable existing in C<%ENV>.
209Don't even count on C<%ENV> entries being case-sensitive, or even
210case-preserving.
211
212Don't count on signals in portable programs.
213
214Don't count on filename globbing. Use C<opendir>, C<readdir>, and
215C<closedir> instead.
216
b8099c3d
CN
217Don't count on per-program environment variables, or per-program current
218directores.
219
e41182b5
GS
220
221=head2 Interprocess Communication (IPC)
222
223In general, don't directly access the system in code that is meant to be
224portable. That means, no: C<system>, C<exec>, C<fork>, C<pipe>, C<``>,
225C<qx//>, C<open> with a C<|>, or any of the other things that makes being
226a Unix perl hacker worth being.
227
228Commands that launch external processes are generally supported on
229most platforms (though many of them do not support any type of forking),
230but the problem with using them arises from what you invoke with them.
231External tools are often named differently on different platforms, often
232not available in the same location, often accept different arguments,
233often behave differently, and often represent their results in a
234platform-dependent way. Thus you should seldom depend on them to produce
235consistent results.
236
237One especially common bit of Perl code is opening a pipe to sendmail:
238
239 open(MAIL, '|/usr/lib/sendmail -t') or die $!;
240
241This is fine for systems programming when sendmail is known to be
242available. But it is not fine for many non-Unix systems, and even
243some Unix systems that may not have sendmail installed. If a portable
244solution is needed, see the C<Mail::Send> and C<Mail::Mailer> modules
245in the C<MailTools> distribution. C<Mail::Mailer> provides several
246mailing methods, including mail, sendmail, and direct SMTP
247(via C<Net::SMTP>) if a mail transfer agent is not available.
248
249The rule of thumb for portable code is: Do it all in portable Perl, or
250use a module that may internally implement it with platform-specific code,
251but expose a common interface. By portable Perl, we mean code that
252avoids the constructs described in this document as being non-portable.
253
254
255=head2 External Subroutines (XS)
256
257XS code, in general, can be made to work with any platform; but dependent
258libraries, header files, etc., might not be readily available or
259portable, or the XS code itself might be platform-specific, just as Perl
260code might be. If the libraries and headers are portable, then it is
261normally reasonable to make sure the XS code is portable, too.
262
263There is a different kind of portability issue with writing XS
264code: availability of a C compiler on the end-user's system. C brings with
265it its own portability issues, and writing XS code will expose you to
266some of those. Writing purely in perl is a comparatively easier way to
267achieve portability.
268
269
270=head2 Standard Modules
271
272In general, the standard modules work across platforms. Notable
273exceptions are C<CPAN.pm> (which currently makes connections to external
274programs that may not be available), platform-specific modules (like
275C<ExtUtils::MM_VMS>), and DBM modules.
276
277There is no one DBM module that is available on all platforms.
278C<SDBM_File> and the others are generally available on all Unix and DOSish
279ports, but not in MacPerl, where C<NBDM_File> and C<DB_File> are available.
280
281The good news is that at least some DBM module should be available, and
282C<AnyDBM_File> will use whichever module it can find. Of course, then
283the code needs to be fairly strict, dropping to the lowest common
284denominator (e.g., not exceeding 1K for each record).
285
286
287=head2 Time and Date
288
289The system's notion of time of day and calendar date is controlled in widely
290different ways. Don't assume the timezone is stored in C<$ENV{TZ}>, and even
291if it is, don't assume that you can control the timezone through that
292variable.
293
294Don't assume that the epoch starts at January 1, 1970, because that is
295OS-specific. Better to store a date in an unambiguous representation.
296A text representation (like C<1 Jan 1970>) can be easily converted into an
297OS-specific value using a module like C<Date::Parse>. An array of values,
298such as those returned by C<localtime>, can be converted to an OS-specific
299representation using C<Time::Local>.
300
301
302=head2 System Resources
303
304If your code is destined for systems with severely constrained (or missing!)
305virtual memory systems then you want to be especially mindful of avoiding
306wasteful constructs such as:
307
308 # NOTE: this is no longer "bad" in perl5.005
309 for (0..10000000) {} # bad
310 for (my $x = 0; $x <= 10000000; ++$x) {} # good
311
312 @lines = <VERY_LARGE_FILE>; # bad
313
314 while (<FILE>) {$file .= $_} # sometimes bad
315 $file = join '', <FILE>; # better
316
317The last two may appear unintuitive to most people. The first of those
318two constructs repeatedly grows a string, while the second allocates a
319large chunk of memory in one go. On some systems, the latter is more
320efficient that the former.
321
322=head2 Security
323
f34d0673 324Most multi-user platforms provide basic levels of security that is usually felt
e41182b5
GS
325at the file-system level. Other platforms usually don't (unfortunately).
326Thus the notion of User-ID, or "home" directory, or even the state of
f34d0673 327being logged-in may be unrecognizable on many platforms. If you write
e41182b5
GS
328programs that are security conscious, it is usually best to know what
329type of system you will be operating under, and write code explicitly
330for that platform (or class of platforms).
331
332=head2 Style
333
334For those times when it is necessary to have platform-specific code,
335consider keeping the platform-specific code in one place, making porting
336to other platforms easier. Use the C<Config> module and the special
337variable C<$^O> to differentiate platforms, as described in L<"PLATFORMS">.
338
339
340=head1 CPAN TESTERS
341
342Module uploaded to CPAN are tested by a variety of volunteers on
343different platforms. These CPAN testers are notified by e-mail of each
344new upload, and reply to the list with PASS, FAIL, NA (not applicable to
345this platform), or ???? (unknown), along with any relevant notations.
346
347The purpose of the testing is twofold: one, to help developers fix any
348problems in their code; two, to provide users with information about
349whether or not a given module works on a given platform.
350
351=over 4
352
353=item Mailing list: cpan-testers@perl.org
354
355=item Testing results: C<http://www.connect.net/gbarr/cpan-test/>
356
357=back
358
359
360=head1 PLATFORMS
361
362As of version 5.002, Perl is built with a C<$^O> variable that
363indicates the operating system it was built on. This was implemented
364to help speed up code that would otherwise have to C<use Config;> and
365use the value of C<$Config{'osname'}>. Of course, to get
366detailed information about the system, looking into C<%Config> is
367certainly recommended.
368
369=head2 Unix
370
371Perl works on a bewildering variety of Unix and Unix-like platforms (see
372e.g. most of the files in the F<hints/> directory in the source code kit).
373On most of these systems, the value of C<$^O> (hence C<$Config{'osname'}>,
374too) is determined by lowercasing and stripping punctuation from the first
375field of the string returned by typing
376
377 % uname -a
378
379(or a similar command) at the shell prompt. Here, for example, are a few
380of the more popular Unix flavors:
381
f34d0673
GS
382 uname $^O $Config{'archname'}
383 -------------------------------------------
e41182b5
GS
384 AIX aix
385 FreeBSD freebsd
386 Linux linux
387 HP-UX hpux
388 OSF1 dec_osf
f34d0673
GS
389 SunOS solaris sun4-solaris
390 SunOS solaris i86pc-solaris
e41182b5
GS
391 SunOS4 sunos
392
393
394=head2 DOS and Derivatives
395
396Perl has long been ported to PC style microcomputers running under
397systems like PC-DOS, MS-DOS, OS/2, and most Windows platforms you can
398bring yourself to mention (except for Windows CE, if you count that).
399Users familiar with I<COMMAND.COM> and/or I<CMD.EXE> style shells should
400be aware that each of these file specifications may have subtle
401differences:
402
403 $filespec0 = "c:/foo/bar/file.txt";
404 $filespec1 = "c:\\foo\\bar\\file.txt";
405 $filespec2 = 'c:\foo\bar\file.txt';
406 $filespec3 = 'c:\\foo\\bar\\file.txt';
407
408System calls accept either C</> or C<\> as the path separator. However,
409many command-line utilities of DOS vintage treat C</> as the option
410prefix, so they may get confused by filenames containing C</>. Aside
411from calling any external programs, C</> will work just fine, and
412probably better, as it is more consistent with popular usage, and avoids
413the problem of remembering what to backwhack and what not to.
414
b8099c3d 415The DOS FAT file system can only accommodate "8.3" style filenames. Under
e41182b5
GS
416the "case insensitive, but case preserving" HPFS (OS/2) and NTFS (NT)
417file systems you may have to be careful about case returned with functions
418like C<readdir> or used with functions like C<open> or C<opendir>.
419
420DOS also treats several filenames as special, such as AUX, PRN, NUL, CON,
421COM1, LPT1, LPT2 etc. Unfortunately these filenames won't even work
422if you include an explicit directory prefix, in some cases. It is best
423to avoid such filenames, if you want your code to be portable to DOS
424and its derivatives.
425
426Users of these operating systems may also wish to make use of
427scripts such as I<pl2bat.bat> or I<pl2cmd> as appropriate to
428put wrappers around your scripts.
429
430Newline (C<\n>) is translated as C<\015\012> by STDIO when reading from
431and writing to files. C<binmode(FILEHANDLE)> will keep C<\n> translated
432as C<\012> for that filehandle. Since it is a noop on other systems,
433C<binmode> should be used for cross-platform code that deals with binary
434data.
435
436The C<$^O> variable and the C<$Config{'archname'}> values for various
437DOSish perls are as follows:
438
439 OS $^O $Config{'archname'}
440 --------------------------------------------
441 MS-DOS dos
442 PC-DOS dos
443 OS/2 os2
444 Windows 95 MSWin32 MSWin32-x86
445 Windows NT MSWin32 MSWin32-x86
446 Windows NT MSWin32 MSWin32-alpha
447 Windows NT MSWin32 MSWin32-ppc
448
449Also see:
450
451=over 4
452
453=item The djgpp environment for DOS, C<http://www.delorie.com/djgpp/>
454
455=item The EMX environment for DOS, OS/2, etc. C<emx@iaehv.nl>,
456C<http://www.juge.com/bbs/Hobb.19.html>
457
458=item Build instructions for Win32, L<perlwin32>.
459
460=item The ActiveState Pages, C<http://www.activestate.com/>
461
462=back
463
464
465=head2 MacPerl
466
467Any module requiring XS compilation is right out for most people, because
468MacPerl is built using non-free (and non-cheap!) compilers. Some XS
469modules that can work with MacPerl are built and distributed in binary
470form on CPAN. See I<MacPerl: Power and Ease> for more details.
471
472Directories are specified as:
473
474 volume:folder:file for absolute pathnames
475 volume:folder: for absolute pathnames
476 :folder:file for relative pathnames
477 :folder: for relative pathnames
478 :file for relative pathnames
479 file for relative pathnames
480
481Files in a directory are stored in alphabetical order. Filenames are
482limited to 31 characters, and may include any character except C<:>,
483which is reserved as a path separator.
484
485Instead of C<flock>, see C<FSpSetFLock> and C<FSpRstFLock> in
486C<Mac::Files>.
487
488In the MacPerl application, you can't run a program from the command line;
489programs that expect C<@ARGV> to be populated can be edited with something
490like the following, which brings up a dialog box asking for the command
491line arguments.
492
493 if (!@ARGV) {
494 @ARGV = split /\s+/, MacPerl::Ask('Arguments?');
495 }
496
497A MacPerl script saved as a droplet will populate C<@ARGV> with the full
498pathnames of the files dropped onto the script.
499
500Mac users can use programs on a kind of command line under MPW (Macintosh
501Programmer's Workshop, a free development environment from Apple).
502MacPerl was first introduced as an MPW tool, and MPW can be used like a
503shell:
504
505 perl myscript.plx some arguments
506
507ToolServer is another app from Apple that provides access to MPW tools
508from MPW and the MacPerl app, which allows MacPerl program to use
509C<system>, backticks, and piped C<open>.
510
511"S<Mac OS>" is the proper name for the operating system, but the value
512in C<$^O> is "MacOS". To determine architecture, version, or whether
513the application or MPW tool version is running, check:
514
515 $is_app = $MacPerl::Version =~ /App/;
516 $is_tool = $MacPerl::Version =~ /MPW/;
517 ($version) = $MacPerl::Version =~ /^(\S+)/;
518 $is_ppc = $MacPerl::Architecture eq 'MacPPC';
519 $is_68k = $MacPerl::Architecture eq 'Mac68K';
520
521
522Also see:
523
524=over 4
525
526=item The MacPerl Pages, C<http://www.ptf.com/macperl/>.
527
528=item The MacPerl mailing list, C<mac-perl-request@iis.ee.ethz.ch>.
529
530=back
531
532
533=head2 VMS
534
535Perl on VMS is discussed in F<vms/perlvms.pod> in the perl distribution.
536Note that perl on VMS can accept either VMS or Unix style file
537specifications as in either of the following:
538
539 $ perl -ne "print if /perl_setup/i" SYS$LOGIN:LOGIN.COM
540 $ perl -ne "print if /perl_setup/i" /sys$login/login.com
541
542but not a mixture of both as in:
543
544 $ perl -ne "print if /perl_setup/i" sys$login:/login.com
545 Can't open sys$login:/login.com: file specification syntax error
546
547Interacting with Perl from the Digital Command Language (DCL) shell
548often requires a different set of quotation marks than Unix shells do.
549For example:
550
551 $ perl -e "print ""Hello, world.\n"""
552 Hello, world.
553
554There are a number of ways to wrap your perl scripts in DCL .COM files if
555you are so inclined. For example:
556
557 $ write sys$output "Hello from DCL!"
558 $ if p1 .eqs. ""
559 $ then perl -x 'f$environment("PROCEDURE")
560 $ else perl -x - 'p1 'p2 'p3 'p4 'p5 'p6 'p7 'p8
561 $ deck/dollars="__END__"
562 #!/usr/bin/perl
563
564 print "Hello from Perl!\n";
565
566 __END__
567 $ endif
568
569Do take care with C<$ ASSIGN/nolog/user SYS$COMMAND: SYS$INPUT> if your
570perl-in-DCL script expects to do things like C<$read = E<lt>STDINE<gt>;>.
571
572Filenames are in the format "name.extension;version". The maximum
573length for filenames is 39 characters, and the maximum length for
574extensions is also 39 characters. Version is a number from 1 to
57532767. Valid characters are C</[A-Z0-9$_-]/>.
576
577VMS' RMS filesystem is case insensitive and does not preserve case.
578C<readdir> returns lowercased filenames, but specifying a file for
b8099c3d 579opening remains case insensitive. Files without extensions have a
e41182b5
GS
580trailing period on them, so doing a C<readdir> with a file named F<A.;5>
581will return F<a.> (though that file could be opened with C<open(FH, 'A')>.
582
f34d0673
GS
583RMS had an eight level limit on directory depths from any rooted logical
584(allowing 16 levels overall) prior to VMS 7.2. Hence
585C<PERL_ROOT:[LIB.2.3.4.5.6.7.8]> is a valid directory specification but
586C<PERL_ROOT:[LIB.2.3.4.5.6.7.8.9]> is not. F<Makefile.PL> authors might
587have to take this into account, but at least they can refer to the former
588as C</PERL_ROOT/lib/2/3/4/5/6/7/8/>.
e41182b5
GS
589
590The C<VMS::Filespec> module, which gets installed as part
591of the build process on VMS, is a pure Perl module that can easily be
592installed on non-VMS platforms and can be helpful for conversions to
593and from RMS native formats.
594
595What C<\n> represents depends on the type of file that is open. It could
596be C<\015>, C<\012>, C<\015\012>, or nothing. Reading from a file
597translates newlines to C<\012>, unless C<binmode> was executed on that
598handle, just like DOSish perls.
599
600TCP/IP stacks are optional on VMS, so socket routines might not be
601implemented. UDP sockets may not be supported.
602
603The value of C<$^O> on OpenVMS is "VMS". To determine the architecture
604that you are running on without resorting to loading all of C<%Config>
605you can examine the content of the C<@INC> array like so:
606
607 if (grep(/VMS_AXP/, @INC)) {
608 print "I'm on Alpha!\n";
609 } elsif (grep(/VMS_VAX/, @INC)) {
610 print "I'm on VAX!\n";
611 } else {
612 print "I'm not so sure about where $^O is...\n";
613 }
614
615Also see:
616
617=over 4
618
619=item L<perlvms.pod>
620
621=item vmsperl list, C<vmsperl-request@newman.upenn.edu>
622
623Put words C<SUBSCRIBE VMSPERL> in message body.
624
625=item vmsperl on the web, C<http://www.sidhe.org/vmsperl/index.html>
626
627=back
628
629
630=head2 EBCDIC Platforms
631
632Recent versions of Perl have been ported to platforms such as OS/400 on
633AS/400 minicomputers as well as OS/390 for IBM Mainframes. Such computers
634use EBCDIC character sets internally (usually Character Code Set ID 00819
635for OS/400 and IBM-1047 for OS/390). Note that on the mainframe perl
636currently works under the "Unix system services for OS/390" (formerly
637known as OpenEdition).
638
639As of R2.5 of USS for OS/390 that Unix sub-system did not support the
640C<#!> shebang trick for script invocation. Hence, on OS/390 perl scripts
641can executed with a header similar to the following simple script:
642
643 : # use perl
644 eval 'exec /usr/local/bin/perl -S $0 ${1+"$@"}'
645 if 0;
646 #!/usr/local/bin/perl # just a comment really
647
648 print "Hello from perl!\n";
649
650On these platforms, bear in mind that the EBCDIC character set may have
651an effect on what happens with perl functions such as C<chr>, C<pack>,
652C<print>, C<printf>, C<ord>, C<sort>, C<sprintf>, C<unpack>; as well as
653bit-fiddling with ASCII constants using operators like C<^>, C<&> and
654C<|>; not to mention dealing with socket interfaces to ASCII computers
655(see L<"NEWLINES">).
656
657Fortunately, most web servers for the mainframe will correctly translate
658the C<\n> in the following statement to its ASCII equivalent (note that
659C<\r> is the same under both ASCII and EBCDIC):
660
661 print "Content-type: text/html\r\n\r\n";
662
663The value of C<$^O> on OS/390 is "os390".
664
665Some simple tricks for determining if you are running on an EBCDIC
666platform could include any of the following (perhaps all):
667
668 if ("\t" eq "\05") { print "EBCDIC may be spoken here!\n"; }
669
670 if (ord('A') == 193) { print "EBCDIC may be spoken here!\n"; }
671
672 if (chr(169) eq 'z') { print "EBCDIC may be spoken here!\n"; }
673
674Note that one thing you may not want to rely on is the EBCDIC encoding
675of punctuation characters since these may differ from code page to code page
676(and once your module or script is rumoured to work with EBCDIC, folks will
677want it to work with all EBCDIC character sets).
678
679Also see:
680
681=over 4
682
683=item perl-mvs list
684
685The perl-mvs@perl.org list is for discussion of porting issues as well as
686general usage issues for all EBCDIC Perls. Send a message body of
687"subscribe perl-mvs" to majordomo@perl.org.
688
689=item AS/400 Perl information at C<http://as400.rochester.ibm.com>
690
691=back
692
b8099c3d
CN
693
694=head2 Acorn RISC OS
695
696As Acorns use ASCII with newlines (C<\n>) in text files as C<\012> like Unix
697and Unix filename emulation is turned on by default, it is quite likely that
698most simple scripts will work "out of the box". The native filing system is
699modular, and individual filing systems are free to be case sensitive or
700insensitive, usually case preserving. Some native filing systems have name
701length limits which file and directory names are silently truncated to fit -
702scripts should be aware that the standard disc filing system currently has
703a name length limit of B<10> characters, with up to 77 items in a directory,
704but other filing systems may not impose such limitations.
705
706Native filenames are of the form
707
708 Filesystem#Special_Field::DiscName.$.Directory.Directory.File
709
710where
711
712 Special_Field is not usually present, but may contain . and $ .
713 Filesystem =~ m|[A-Za-z0-9_]|
714 DsicName =~ m|[A-Za-z0-9_/]|
715 $ represents the root directory
716 . is the path separator
717 @ is the current directory (per filesystem but machine global)
718 ^ is the parent directory
719 Directory and File =~ m|[^\0- "\.\$\%\&:\@\\^\|\177]+|
720
721The default filename translation is roughly C<tr|/.|./|;>
722
723Note that C<"ADFS::HardDisc.$.File" ne 'ADFS::HardDisc.$.File'> and that
724the second stage of $ interpolation in regular expressions will fall foul
725of the C<$.> if scripts are not careful.
726
727Logical paths specified by system variables containing comma separated
728search lists are also allowed, hence C<System:Modules> is a valid filename,
729and the filesystem will prefix C<Modules> with each section of C<System$Path>
730until a name is made that points to an object on disc. Writing to a new
731file C<System:Modules> would only be allowed if C<System$Path> contains a
732single item list. The filesystem will also expand system variables in
733filenames if enclosed in angle brackets, so C<E<lt>System$DirE<gt>.Modules>
734would look for the file S<C<$ENV{'System$Dir'} . 'Modules'>>. The obvious
735implication of this is that B<fully qualified filenames can start with C<E<lt>E<gt>>>
736and should be protected when C<open> is used for input.
737
738Because C<.> was in use as a directory separator and filenames could not
739be assumed to be unique after 10 characters, Acorn implemented the C
740compiler to strip the trailing C<.c> C<.h> C<.s> and C<.o> suffix from
741filenames specified in source code and store the respective files in
742subdirectories named after the suffix. Hence files are translated:
743
744 foo.h h.foo
745 C:foo.h C:h.foo (logical path variable)
746 sys/os.h sys.h.os (C compiler groks Unix-speak)
747 10charname.c c.10charname
748 10charname.o o.10charname
749 11charname_.c c.11charname (assuming filesystem truncates at 10)
750
751The Unix emulation library's translation of filenames to native assumes
752that this sort of translation is required, and allows a user defined list of
753known suffixes which it will transpose in this fashion. This may appear
754transparent, but consider that with these rules C<foo/bar/baz.h> and
755C<foo/bar/h/baz> both map to C<foo.bar.h.baz>, and that C<readdir> and
756C<glob> cannot and do not attempt to emulate the reverse mapping. Other '.'s
757in filenames are translated to '/'.
758
759S<RISC OS> has "image files", files that behave as directories. For
760example with suitable software this allows the contents of a zip file to
761be treated as a directory at command line (and therefore script) level,
762with full read-write random access. At present the perl port treats images
763as directories: C<-d> returns true, C<-f> false, and C<unlink> checks to
764ensure that recognised images are empty before deleting them. In theory
765images should never trouble a script, but in practice they may do so if
766the software to deal with an image file is loaded and registered while the
767script is running, as suddenly "files" that it had cached information on
768metamorphose into directories.
769
770As implied above the environment accessed through C<%ENV> is global, and the
771convention is that program specific environment variables are of the form
772C<Program$Name>. Each filing system maintains a current directory, and
773the current filing system's current directory is the B<global> current
774directory. Consequently sociable scripts don't change the current directory
775but rely on full pathnames, and scripts (and Makefiles) cannot assume that
776they can spawn a child process which can change the current directory
777without affecting its parent (and everyone else for that matter).
778
779As native operating system filehandles are global and currently are allocated
780down from 255, with 0 being a reserved value the Unix emulation library
781emulates Unix filehandles. Consequently you can't rely on passing C<STDIN>
782C<STDOUT> or C<STDERR> to your children. Run time libraries perform
783command line processing to emulate Unix shell style C<>> redirection, but
784the core operating system is written in assembler and has its own private,
785obscure and somewhat broken convention. All this is further complicated by
786the desire of users to express filenames of the form C<E<lt>Foo$DirE<gt>.Bar> on
787the command line unquoted. (Oh yes, it's run time libraries interpreting the
788quoting convention.) Hence C<``> command output capture has to perform
789a guessing game as to how the command is going to interpret the command line
790so that it can bodge it correctly to capture output. It assumes that a
791string C<E<lt>[^E<lt>E<gt>]+\$[^E<lt>E<gt>]E<gt>> is a reference to an environment
792variable, whereas anything else involving C<E<lt>> or C<E<gt>> is redirection,
793and generally manages to be 99% right. Despite all this the problem remains
794that scripts cannot rely on any Unix tools being available, or that any tools
795found have Unix-like command line arguments.
796
797Extensions and XS are in theory buildable by anyone using free tools. In
798practice many don't as the Acorn platform is used to binary distribution.
799MakeMaker does itself run, but no make currently copes with MakeMaker's
800makefiles! Even if (when) this is fixed os that the lack of a Unix-like
801shell can cause problems with makefile rules, especially lines of the form
802C<cd sdbm && make all> and anything using quoting.
803
804"S<RISC OS>" is the proper name for the operating system, but the value
805in C<$^O> is "riscos" (because we don't like shouting).
806
807Also see:
808
809=over 4
810
811=item perl list
812
813=back
814
815
e41182b5
GS
816=head2 Other perls
817
b8099c3d
CN
818Perl has been ported to a variety of platforms that do not fit into any of
819the above categories. Some, such as AmigaOS, BeOS, QNX, and Plan 9, have
820been well integrated into the standard Perl source code kit. You may need
821to see the F<ports/> directory on CPAN for information, and possibly
822binaries, for the likes of: aos, atari, lynxos, HP-MPE/iX, riscos,
823Tandem Guardian, vos, I<etc.> (yes we know that some of these OSes may fall
824under the Unix category but we are not a standards body.)
e41182b5
GS
825
826See also:
827
828=over 4
829
830=item Atari, Guido Flohr's page C<http://stud.uni-sb.de/~gufl0000/>
831
832=item HP 300 MPE/iX C<http://www.cccd.edu/~markb/perlix.html>
833
834=item Novell Netware
835
836A free Perl 5 based PERL.NLM for Novell Netware is available from
837C<http://www.novell.com/>
838
839=back
840
841
842=head1 FUNCTION IMPLEMENTATIONS
843
844Listed below are functions unimplemented or implemented differently on
845various platforms. Following each description will be, in parentheses, a
846list of platforms that the description applies to.
847
848The list may very well be incomplete, or wrong in some places. When in
849doubt, consult the platform-specific README files in the Perl source
850distribution, and other documentation resources for a given port.
851
852Be aware, moreover, that even among Unix-ish systems there are variations,
853and not all functions listed here are necessarily available, though
854most usually are.
855
856For many functions, you can also query C<%Config>, exported by default
857from C<Config.pm>. For example, to check if the platform has the C<lstat>
858call, check C<$Config{'d_lstat'}>. See L<Config> for a full description
859of available variables.
860
861
862=head2 Alphabetical Listing of Perl Functions
863
864=over 8
865
866=item -X FILEHANDLE
867
868=item -X EXPR
869
870=item -X
871
872C<-r>, C<-w>, and C<-x> have only a very limited meaning; directories
873and applications are executable, and there are no uid/gid
874considerations. C<-o> is not supported. (S<Mac OS>)
875
876C<-r>, C<-w>, C<-x>, and C<-o> tell whether or not file is accessible,
877which may not reflect UIC-based file protections. (VMS)
878
b8099c3d
CN
879C<-s> returns the size of the data fork, not the total size of data fork
880plus resource fork. (S<Mac OS>).
881
882C<-s> by name on an open file will return the space reserved on disk,
883rather than the current extent. C<-s> on an open filehandle returns the
884current size. (S<RISC OS>)
885
e41182b5 886C<-R>, C<-W>, C<-X>, C<-O> are indistinguishable from C<-r>, C<-w>,
b8099c3d 887C<-x>, C<-o>. (S<Mac OS>, Win32, VMS, S<RISC OS>)
e41182b5
GS
888
889C<-b>, C<-c>, C<-k>, C<-g>, C<-p>, C<-u>, C<-A> are not implemented.
890(S<Mac OS>)
891
892C<-g>, C<-k>, C<-l>, C<-p>, C<-u>, C<-A> are not particularly meaningful.
b8099c3d 893(Win32, VMS, S<RISC OS>)
e41182b5
GS
894
895C<-d> is true if passed a device spec without an explicit directory.
896(VMS)
897
898C<-T> and C<-B> are implemented, but might misclassify Mac text files
899with foreign characters; this is the case will all platforms, but
900affects S<Mac OS> a lot. (S<Mac OS>)
901
902C<-x> (or C<-X>) determine if a file ends in one of the executable
903suffixes. C<-S> is meaningless. (Win32)
904
b8099c3d
CN
905C<-x> (or C<-X>) determine if a file has an executable file type.
906(S<RISC OS>)
907
e41182b5
GS
908=item binmode FILEHANDLE
909
b8099c3d 910Meaningless. (S<Mac OS>, S<RISC OS>)
e41182b5
GS
911
912Reopens file and restores pointer; if function fails, underlying
913filehandle may be closed, or pointer may be in a different position.
914(VMS)
915
916The value returned by C<tell> may be affected after the call, and
917the filehandle may be flushed. (Win32)
918
919=item chmod LIST
920
921Only limited meaning. Disabling/enabling write permission is mapped to
922locking/unlocking the file. (S<Mac OS>)
923
924Only good for changing "owner" read-write access, "group", and "other"
925bits are meaningless. (Win32)
926
b8099c3d
CN
927Only good for changing "owner" and "other" read-write access. (S<RISC OS>)
928
e41182b5
GS
929=item chown LIST
930
b8099c3d 931Not implemented. (S<Mac OS>, Win32, Plan9, S<RISC OS>)
e41182b5
GS
932
933Does nothing, but won't fail. (Win32)
934
935=item chroot FILENAME
936
937=item chroot
938
b8099c3d 939Not implemented. (S<Mac OS>, Win32, VMS, Plan9, S<RISC OS>)
e41182b5
GS
940
941=item crypt PLAINTEXT,SALT
942
943May not be available if library or source was not provided when building
b8099c3d 944perl. (Win32)
e41182b5
GS
945
946=item dbmclose HASH
947
948Not implemented. (VMS, Plan9)
949
950=item dbmopen HASH,DBNAME,MODE
951
952Not implemented. (VMS, Plan9)
953
954=item dump LABEL
955
b8099c3d 956Not useful. (S<Mac OS>, S<RISC OS>)
e41182b5
GS
957
958Not implemented. (Win32)
959
b8099c3d 960Invokes VMS debugger. (VMS)
e41182b5
GS
961
962=item exec LIST
963
964Not implemented. (S<Mac OS>)
965
966=item fcntl FILEHANDLE,FUNCTION,SCALAR
967
968Not implemented. (Win32, VMS)
969
970=item flock FILEHANDLE,OPERATION
971
b8099c3d 972Not implemented (S<Mac OS>, VMS, S<RISC OS>).
e41182b5
GS
973
974Available only on Windows NT (not on Windows 95). (Win32)
975
976=item fork
977
b8099c3d 978Not implemented. (S<Mac OS>, Win32, AmigaOS, S<RISC OS>)
e41182b5
GS
979
980=item getlogin
981
b8099c3d 982Not implemented. (S<Mac OS>, S<RISC OS>)
e41182b5
GS
983
984=item getpgrp PID
985
b8099c3d 986Not implemented. (S<Mac OS>, Win32, VMS, S<RISC OS>)
e41182b5
GS
987
988=item getppid
989
b8099c3d 990Not implemented. (S<Mac OS>, Win32, VMS, S<RISC OS>)
e41182b5
GS
991
992=item getpriority WHICH,WHO
993
b8099c3d 994Not implemented. (S<Mac OS>, Win32, VMS, S<RISC OS>)
e41182b5
GS
995
996=item getpwnam NAME
997
998Not implemented. (S<Mac OS>, Win32)
999
b8099c3d
CN
1000Not useful. (S<RISC OS>)
1001
e41182b5
GS
1002=item getgrnam NAME
1003
b8099c3d 1004Not implemented. (S<Mac OS>, Win32, VMS, S<RISC OS>)
e41182b5
GS
1005
1006=item getnetbyname NAME
1007
1008Not implemented. (S<Mac OS>, Win32, Plan9)
1009
1010=item getpwuid UID
1011
1012Not implemented. (S<Mac OS>, Win32)
1013
b8099c3d
CN
1014Not useful. (S<RISC OS>)
1015
e41182b5
GS
1016=item getgrgid GID
1017
b8099c3d 1018Not implemented. (S<Mac OS>, Win32, VMS, S<RISC OS>)
e41182b5
GS
1019
1020=item getnetbyaddr ADDR,ADDRTYPE
1021
1022Not implemented. (S<Mac OS>, Win32, Plan9)
1023
1024=item getprotobynumber NUMBER
1025
1026Not implemented. (S<Mac OS>)
1027
1028=item getservbyport PORT,PROTO
1029
1030Not implemented. (S<Mac OS>)
1031
1032=item getpwent
1033
1034Not implemented. (S<Mac OS>, Win32)
1035
1036=item getgrent
1037
1038Not implemented. (S<Mac OS>, Win32, VMS)
1039
1040=item gethostent
1041
1042Not implemented. (S<Mac OS>, Win32)
1043
1044=item getnetent
1045
1046Not implemented. (S<Mac OS>, Win32, Plan9)
1047
1048=item getprotoent
1049
1050Not implemented. (S<Mac OS>, Win32, Plan9)
1051
1052=item getservent
1053
1054Not implemented. (Win32, Plan9)
1055
1056=item setpwent
1057
b8099c3d 1058Not implemented. (S<Mac OS>, Win32, S<RISC OS>)
e41182b5
GS
1059
1060=item setgrent
1061
b8099c3d 1062Not implemented. (S<Mac OS>, Win32, VMS, S<RISC OS>)
e41182b5
GS
1063
1064=item sethostent STAYOPEN
1065
b8099c3d 1066Not implemented. (S<Mac OS>, Win32, Plan9, S<RISC OS>)
e41182b5
GS
1067
1068=item setnetent STAYOPEN
1069
b8099c3d 1070Not implemented. (S<Mac OS>, Win32, Plan9, S<RISC OS>)
e41182b5
GS
1071
1072=item setprotoent STAYOPEN
1073
b8099c3d 1074Not implemented. (S<Mac OS>, Win32, Plan9, S<RISC OS>)
e41182b5
GS
1075
1076=item setservent STAYOPEN
1077
b8099c3d 1078Not implemented. (Plan9, Win32, S<RISC OS>)
e41182b5
GS
1079
1080=item endpwent
1081
1082Not implemented. (S<Mac OS>, Win32)
1083
1084=item endgrent
1085
b8099c3d 1086Not implemented. (S<Mac OS>, Win32, VMS, S<RISC OS>)
e41182b5
GS
1087
1088=item endhostent
1089
1090Not implemented. (S<Mac OS>, Win32)
1091
1092=item endnetent
1093
1094Not implemented. (S<Mac OS>, Win32, Plan9)
1095
1096=item endprotoent
1097
1098Not implemented. (S<Mac OS>, Win32, Plan9)
1099
1100=item endservent
1101
1102Not implemented. (Plan9, Win32)
1103
1104=item getsockopt SOCKET,LEVEL,OPTNAME
1105
1106Not implemented. (S<Mac OS>, Plan9)
1107
1108=item glob EXPR
1109
1110=item glob
1111
1112Globbing built-in, but only C<*> and C<?> metacharacters are supported.
1113(S<Mac OS>)
1114
1115Features depend on external perlglob.exe or perlglob.bat. May be overridden
1116with something like File::DosGlob, which is recommended. (Win32)
1117
b8099c3d
CN
1118Globbing built-in, but only C<*> and C<?> metacharacters are supported.
1119Globbing relies on operating system calls, which may return filenames in
1120any order. As most filesystems are case insensitive even "sorted"
1121filenames will not be in case sensitive order. (S<RISC OS>)
1122
e41182b5
GS
1123=item ioctl FILEHANDLE,FUNCTION,SCALAR
1124
1125Not implemented. (VMS)
1126
1127Available only for socket handles, and it does what the ioctlsocket() call
1128in the Winsock API does. (Win32)
1129
b8099c3d
CN
1130Available only for socket handles. (S<RISC OS>)
1131
e41182b5
GS
1132=item kill LIST
1133
b8099c3d 1134Not implemented, hence not useful for taint checking. (S<Mac OS>, S<RISC OS>)
e41182b5
GS
1135
1136Available only for process handles returned by the C<system(1, ...)> method of
b8099c3d 1137spawning a process. (Win32)
e41182b5
GS
1138
1139=item link OLDFILE,NEWFILE
1140
b8099c3d 1141Not implemented. (S<Mac OS>, Win32, VMS, S<RISC OS>)
e41182b5
GS
1142
1143=item lstat FILEHANDLE
1144
1145=item lstat EXPR
1146
1147=item lstat
1148
b8099c3d 1149Not implemented. (VMS, S<RISC OS>)
e41182b5 1150
b8099c3d 1151Return values may be bogus. (Win32)
e41182b5
GS
1152
1153=item msgctl ID,CMD,ARG
1154
1155=item msgget KEY,FLAGS
1156
1157=item msgsnd ID,MSG,FLAGS
1158
1159=item msgrcv ID,VAR,SIZE,TYPE,FLAGS
1160
b8099c3d 1161Not implemented. (S<Mac OS>, Win32, VMS, Plan9, S<RISC OS>)
e41182b5
GS
1162
1163=item open FILEHANDLE,EXPR
1164
1165=item open FILEHANDLE
1166
1167The C<|> variants are only supported if ToolServer is installed.
1168(S<Mac OS>)
1169
b8099c3d 1170open to C<|-> and C<-|> are unsupported. (S<Mac OS>, Win32, S<RISC OS>)
e41182b5
GS
1171
1172=item pipe READHANDLE,WRITEHANDLE
1173
1174Not implemented. (S<Mac OS>)
1175
1176=item readlink EXPR
1177
1178=item readlink
1179
b8099c3d 1180Not implemented. (Win32, VMS, S<RISC OS>)
e41182b5
GS
1181
1182=item select RBITS,WBITS,EBITS,TIMEOUT
1183
1184Only implemented on sockets. (Win32)
1185
b8099c3d
CN
1186Only reliable on sockets. (S<RISC OS>)
1187
e41182b5
GS
1188=item semctl ID,SEMNUM,CMD,ARG
1189
1190=item semget KEY,NSEMS,FLAGS
1191
1192=item semop KEY,OPSTRING
1193
b8099c3d 1194Not implemented. (S<Mac OS>, Win32, VMS, S<RISC OS>)
e41182b5
GS
1195
1196=item setpgrp PID,PGRP
1197
b8099c3d 1198Not implemented. (S<Mac OS>, Win32, VMS, S<RISC OS>)
e41182b5
GS
1199
1200=item setpriority WHICH,WHO,PRIORITY
1201
b8099c3d 1202Not implemented. (S<Mac OS>, Win32, VMS, S<RISC OS>)
e41182b5
GS
1203
1204=item setsockopt SOCKET,LEVEL,OPTNAME,OPTVAL
1205
1206Not implemented. (S<Mac OS>, Plan9)
1207
1208=item shmctl ID,CMD,ARG
1209
1210=item shmget KEY,SIZE,FLAGS
1211
1212=item shmread ID,VAR,POS,SIZE
1213
1214=item shmwrite ID,STRING,POS,SIZE
1215
b8099c3d 1216Not implemented. (S<Mac OS>, Win32, VMS, S<RISC OS>)
e41182b5
GS
1217
1218=item socketpair SOCKET1,SOCKET2,DOMAIN,TYPE,PROTOCOL
1219
b8099c3d 1220Not implemented. (S<Mac OS>, Win32, VMS, S<RISC OS>)
e41182b5
GS
1221
1222=item stat FILEHANDLE
1223
1224=item stat EXPR
1225
1226=item stat
1227
1228mtime and atime are the same thing, and ctime is creation time instead of
1229inode change time. (S<Mac OS>)
1230
1231device and inode are not meaningful. (Win32)
1232
1233device and inode are not necessarily reliable. (VMS)
1234
b8099c3d
CN
1235mtime, atime and ctime all return the last modification time. Device and
1236inode are not necessarily reliable. (S<RISC OS>)
1237
e41182b5
GS
1238=item symlink OLDFILE,NEWFILE
1239
b8099c3d 1240Not implemented. (Win32, VMS, S<RISC OS>)
e41182b5
GS
1241
1242=item syscall LIST
1243
b8099c3d 1244Not implemented. (S<Mac OS>, Win32, VMS, S<RISC OS>)
e41182b5 1245
f34d0673
GS
1246=item sysopen FILEHANDLE,FILENAME,MODE,PERMS
1247
1248The traditional "0", "1", and "2" MODEs are implemented with different
1249numeric values on some systems. The flags exported by C<Fcntl> should work
1250everywhere though. (S<Mac OS>, OS/390)
1251
e41182b5
GS
1252=item system LIST
1253
1254Only implemented if ToolServer is installed. (S<Mac OS>)
1255
1256As an optimization, may not call the command shell specified in
1257C<$ENV{PERL5SHELL}>. C<system(1, @args)> spawns an external
1258process and immediately returns its process designator, without
1259waiting for it to terminate. Return value may be used subsequently
1260in C<wait> or C<waitpid>. (Win32)
1261
b8099c3d
CN
1262There is no shell to process metacharacters, and the native standard is
1263to pass a command line terminated by "\n" "\r" or "\0" to the spawned
1264program. Redirection such as C<E<gt> foo> is performed (if at all) by
1265the run time library of the spawned program. C<system> I<list> will call
1266the Unix emulation library's C<exec> emulation, which attempts to provide
1267emulation of the stdin, stdout, stderr in force in the parent, providing
1268the child program uses a compatible version of the emulation library.
1269I<scalar> will call the native command line direct and no such emulation
1270of a child Unix program will exists. Mileage B<will> vary. (S<RISC OS>)
1271
e41182b5
GS
1272=item times
1273
1274Only the first entry returned is nonzero. (S<Mac OS>)
1275
1276"cumulative" times will be bogus. On anything other than Windows NT,
1277"system" time will be bogus, and "user" time is actually the time
1278returned by the clock() function in the C runtime library. (Win32)
1279
b8099c3d
CN
1280Not useful. (S<RISC OS>)
1281
e41182b5
GS
1282=item truncate FILEHANDLE,LENGTH
1283
1284=item truncate EXPR,LENGTH
1285
1286Not implemented. (VMS)
1287
1288=item umask EXPR
1289
1290=item umask
1291
1292Returns undef where unavailable, as of version 5.005.
1293
1294=item utime LIST
1295
b8099c3d 1296Only the modification time is updated. (S<Mac OS>, VMS, S<RISC OS>)
e41182b5
GS
1297
1298May not behave as expected. (Win32)
1299
1300=item wait
1301
1302=item waitpid PID,FLAGS
1303
1304Not implemented. (S<Mac OS>)
1305
1306Can only be applied to process handles returned for processes spawned
1307using C<system(1, ...)>. (Win32)
1308
b8099c3d
CN
1309Not useful. (S<RISC OS>)
1310
e41182b5
GS
1311=back
1312
b8099c3d
CN
1313=head1 CHANGES
1314
1315=over 4
1316
1317=item 1.30, 03 August 1998
1318
1319Major update for RISC OS, other minor changes.
1320
1321=item 1.23, 10 July 1998
1322
1323First public release with perl5.005.
1324
1325=back
e41182b5
GS
1326
1327=head1 AUTHORS / CONTRIBUTORS
1328
1329Chris Nandor E<lt>pudge@pobox.comE<gt>,
1330Gurusamy Sarathy E<lt>gsar@umich.eduE<gt>,
1331Peter Prymmer E<lt>pvhp@forte.comE<gt>,
1332Tom Christiansen E<lt>tchrist@perl.comE<gt>,
1333Nathan Torkington E<lt>gnat@frii.comE<gt>,
1334Paul Moore E<lt>Paul.Moore@uk.origin-it.comE<gt>,
1335Matthias Neercher E<lt>neeri@iis.ee.ethz.chE<gt>,
1336Charles Bailey E<lt>bailey@genetics.upenn.eduE<gt>,
1337Luther Huffman E<lt>lutherh@stratcom.comE<gt>,
1338Gary Ng E<lt>71564.1743@CompuServe.COME<gt>,
1339Nick Ing-Simmons E<lt>nick@ni-s.u-net.comE<gt>,
1340Paul J. Schinder E<lt>schinder@pobox.comE<gt>,
1341Tom Phoenix E<lt>rootbeer@teleport.comE<gt>,
1342Hugo van der Sanden E<lt>h.sanden@elsevier.nlE<gt>,
1343Dominic Dunlop E<lt>domo@vo.luE<gt>,
1344Dan Sugalski E<lt>sugalskd@ous.eduE<gt>,
1345Andreas J. Koenig E<lt>koenig@kulturbox.deE<gt>,
1346Andrew M. Langmead E<lt>aml@world.std.comE<gt>,
1347Andy Dougherty E<lt>doughera@lafcol.lafayette.eduE<gt>,
b8099c3d
CN
1348Abigail E<lt>abigail@fnx.comE<gt>,
1349Nicholas Clark E<lt>Nicholas.Clark@liverpool.ac.ukE<gt>.
e41182b5
GS
1350
1351This document is maintained by Chris Nandor.
1352
1353=head1 VERSION
1354
b8099c3d 1355Version 1.30, last modified 03 August 1998.
e41182b5 1356