This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perlipc: modernize open and handle usage
[perl5.git] / README.os400
CommitLineData
522b859a
JH
1If you read this file _as_is_, just ignore the funny characters you see.
2It is written in the POD format (see pod/perlpod.pod) which is specially
3designed to be readable as is.
4
5=head1 NAME
6
de2902a6 7perlos400 - Perl version 5 on OS/400
522b859a 8
2b7f2baa
KW
9B<This document needs to be updated, but we don't know what it should say.
10Please email comments to L<perlbug@perl.org|mailto:perlbug@perl.org>.>
11
522b859a
JH
12=head1 DESCRIPTION
13
14This document describes various features of IBM's OS/400 operating
15system that will affect how Perl version 5 (hereafter just Perl) is
16compiled and/or runs.
17
18By far the easiest way to build Perl for OS/400 is to use the PASE
19(Portable Application Solutions Environment), for more information see
635d4d9b 20L<http://www.iseries.ibm.com/developer/factory/pase/index.html>
522b859a
JH
21This environment allows one to use AIX APIs while programming, and it
22provides a runtime that allows AIX binaries to execute directly on the
23PowerPC iSeries.
24
25=head2 Compiling Perl for OS/400 PASE
26
27The recommended way to build Perl for the OS/400 PASE is to build the
28Perl 5 source code (release 5.8.1 or later) under AIX.
29
30The trick is to give a special parameter to the Configure shell script
31when running it on AIX:
32
33 sh Configure -DPASE ...
34
35The default installation directory of Perl under PASE is /QOpenSys/perl.
36This can be modified if needed with Configure parameter -Dprefix=/some/dir.
37
38Starting from OS/400 V5R2 the IBM Visual Age compiler is supported
39on OS/400 PASE, so it is possible to build Perl natively on OS/400.
40The easier way, however, is to compile in AIX, as just described.
41
64e35db4
RGS
42If you don't want to install the compiled Perl in AIX into /QOpenSys
43(for packaging it before copying it to PASE), you can use a Configure
44parameter: -Dinstallprefix=/tmp/QOpenSys/perl. This will cause the
45"make install" to install everything into that directory, while the
46installed files still think they are (will be) in /QOpenSys/perl.
47
522b859a
JH
48If building natively on PASE, please do the build under the /QOpenSys
49directory, since Perl is happier when built on a case sensitive filesystem.
50
51=head2 Installing Perl in OS/400 PASE
52
53If you are compiling on AIX, simply do a "make install" on the AIX box.
54Once the install finishes, tar up the /QOpenSys/perl directory. Transfer
55the tarball to the OS/400 using FTP with the following commands:
56
57 > binary
58 > site namefmt 1
59 > put perl.tar /QOpenSys
60
61Once you have it on, simply bring up a PASE shell and extract the tarball.
62
63If you are compiling in PASE, then "make install" is the only thing you
64will need to do.
65
66The default path for perl binary is /QOpenSys/perl/bin/perl. You'll
67want to symlink /QOpenSys/usr/bin/perl to this file so you don't have
68to modify your path.
69
70=head2 Using Perl in OS/400 PASE
71
72Perl in PASE may be used in the same manner as you would use Perl on AIX.
73
74Scripts starting with #!/usr/bin/perl should work if you have
75/QOpenSys/usr/bin/perl symlinked to your perl binary. This will not
76work if you've done a setuid/setgid or have environment variable
77PASE_EXEC_QOPENSYS="N". If you have V5R1, you'll need to get the
78latest PTFs to have this feature. Scripts starting with
79#!/QOpenSys/perl/bin/perl should always work.
80
954a4c1b
JH
81=head2 Known Problems
82
61074b56
JH
83When compiling in PASE, there is no "oslevel" command. Therefore,
84you may want to create a script called "oslevel" that echoes the
85level of AIX that your version of PASE runtime supports. If you're
86unsure, consult your documentation or use "4.3.3.0".
87
88If you have test cases that fail, check for the existence of spool files.
89The test case may be trying to use a syscall that is not implemented
90in PASE. To avoid the SIGILL, try setting the PASE_SYSCALL_NOSIGILL
91environment variable or have a handler for the SIGILL. If you can
92compile programs for PASE, run the config script and edit config.sh
93when it gives you the option. If you want to remove fchdir(), which
94isn't implement in V5R1, simply change the line that says:
95
96d_fchdir='define'
97
98to
99
100d_fchdir='undef'
101
102and then compile Perl. The places where fchdir() is used have
103alternatives for systems that do not have fchdir() available.
954a4c1b 104
522b859a
JH
105=head2 Perl on ILE
106
107There exists a port of Perl to the ILE environment. This port, however,
108is based quite an old release of Perl, Perl 5.00502 (August 1998).
109(As of July 2002 the latest release of Perl is 5.8.0, and even 5.6.1
110has been out since April 2001.) If you need to run Perl on ILE, though,
635d4d9b 111you may need this older port: L<http://www.cpan.org/ports/#os400>
522b859a
JH
112Note that any Perl release later than 5.00502 has not been ported to ILE.
113
114If you need to use Perl in the ILE environment, you may want to consider
115using Qp2RunPase() to call the PASE version of Perl.
116
117=head1 AUTHORS
118
119Jarkko Hietaniemi <jhi@iki.fi>
120Bryan Logan <bryanlog@us.ibm.com>
121David Larson <larson1@us.ibm.com>
122
123=cut