1*e0680481Safresh1# vim: syntax=pod 2*e0680481Safresh1 385009909SmillertIf you read this file _as_is_, just ignore the funny characters you see. 485009909SmillertIt is written in the POD format (see pod/perlpod.pod) which is specially 585009909Smillertdesigned to be readable as is. 685009909Smillert 785009909Smillert=head1 NAME 885009909Smillert 9898184e3Ssthenperlos400 - Perl version 5 on OS/400 1085009909Smillert 11b8851fccSafresh1B<This document needs to be updated, but we don't know what it should say. 1298dafc01Safresh1Please submit comments to L<https://github.com/Perl/perl5/issues>.> 13b8851fccSafresh1 1485009909Smillert=head1 DESCRIPTION 1585009909Smillert 1685009909SmillertThis document describes various features of IBM's OS/400 operating 1785009909Smillertsystem that will affect how Perl version 5 (hereafter just Perl) is 1885009909Smillertcompiled and/or runs. 1985009909Smillert 2085009909SmillertBy far the easiest way to build Perl for OS/400 is to use the PASE 2185009909Smillert(Portable Application Solutions Environment), for more information see 22898184e3SsthenL<http://www.iseries.ibm.com/developer/factory/pase/index.html> 2385009909SmillertThis environment allows one to use AIX APIs while programming, and it 2485009909Smillertprovides a runtime that allows AIX binaries to execute directly on the 2585009909SmillertPowerPC iSeries. 2685009909Smillert 2785009909Smillert=head2 Compiling Perl for OS/400 PASE 2885009909Smillert 2985009909SmillertThe recommended way to build Perl for the OS/400 PASE is to build the 3085009909SmillertPerl 5 source code (release 5.8.1 or later) under AIX. 3185009909Smillert 3285009909SmillertThe trick is to give a special parameter to the Configure shell script 3385009909Smillertwhen running it on AIX: 3485009909Smillert 3585009909Smillert sh Configure -DPASE ... 3685009909Smillert 3785009909SmillertThe default installation directory of Perl under PASE is /QOpenSys/perl. 3885009909SmillertThis can be modified if needed with Configure parameter -Dprefix=/some/dir. 3985009909Smillert 4085009909SmillertStarting from OS/400 V5R2 the IBM Visual Age compiler is supported 4185009909Smillerton OS/400 PASE, so it is possible to build Perl natively on OS/400. 4285009909SmillertThe easier way, however, is to compile in AIX, as just described. 4385009909Smillert 4485009909SmillertIf you don't want to install the compiled Perl in AIX into /QOpenSys 4585009909Smillert(for packaging it before copying it to PASE), you can use a Configure 4685009909Smillertparameter: -Dinstallprefix=/tmp/QOpenSys/perl. This will cause the 4785009909Smillert"make install" to install everything into that directory, while the 4885009909Smillertinstalled files still think they are (will be) in /QOpenSys/perl. 4985009909Smillert 5085009909SmillertIf building natively on PASE, please do the build under the /QOpenSys 5185009909Smillertdirectory, since Perl is happier when built on a case sensitive filesystem. 5285009909Smillert 5385009909Smillert=head2 Installing Perl in OS/400 PASE 5485009909Smillert 5585009909SmillertIf you are compiling on AIX, simply do a "make install" on the AIX box. 5685009909SmillertOnce the install finishes, tar up the /QOpenSys/perl directory. Transfer 5785009909Smillertthe tarball to the OS/400 using FTP with the following commands: 5885009909Smillert 5985009909Smillert > binary 6085009909Smillert > site namefmt 1 6185009909Smillert > put perl.tar /QOpenSys 6285009909Smillert 6385009909SmillertOnce you have it on, simply bring up a PASE shell and extract the tarball. 6485009909Smillert 6585009909SmillertIf you are compiling in PASE, then "make install" is the only thing you 6685009909Smillertwill need to do. 6785009909Smillert 6885009909SmillertThe default path for perl binary is /QOpenSys/perl/bin/perl. You'll 6985009909Smillertwant to symlink /QOpenSys/usr/bin/perl to this file so you don't have 7085009909Smillertto modify your path. 7185009909Smillert 7285009909Smillert=head2 Using Perl in OS/400 PASE 7385009909Smillert 7485009909SmillertPerl in PASE may be used in the same manner as you would use Perl on AIX. 7585009909Smillert 7685009909SmillertScripts starting with #!/usr/bin/perl should work if you have 7785009909Smillert/QOpenSys/usr/bin/perl symlinked to your perl binary. This will not 7885009909Smillertwork if you've done a setuid/setgid or have environment variable 7985009909SmillertPASE_EXEC_QOPENSYS="N". If you have V5R1, you'll need to get the 8085009909Smillertlatest PTFs to have this feature. Scripts starting with 8185009909Smillert#!/QOpenSys/perl/bin/perl should always work. 8285009909Smillert 8385009909Smillert=head2 Known Problems 8485009909Smillert 8585009909SmillertWhen compiling in PASE, there is no "oslevel" command. Therefore, 8685009909Smillertyou may want to create a script called "oslevel" that echoes the 8785009909Smillertlevel of AIX that your version of PASE runtime supports. If you're 8885009909Smillertunsure, consult your documentation or use "4.3.3.0". 8985009909Smillert 9085009909SmillertIf you have test cases that fail, check for the existence of spool files. 9185009909SmillertThe test case may be trying to use a syscall that is not implemented 9285009909Smillertin PASE. To avoid the SIGILL, try setting the PASE_SYSCALL_NOSIGILL 9385009909Smillertenvironment variable or have a handler for the SIGILL. If you can 9485009909Smillertcompile programs for PASE, run the config script and edit config.sh 9585009909Smillertwhen it gives you the option. If you want to remove fchdir(), which 9685009909Smillertisn't implement in V5R1, simply change the line that says: 9785009909Smillert 9885009909Smillertd_fchdir='define' 9985009909Smillert 10085009909Smillertto 10185009909Smillert 10285009909Smillertd_fchdir='undef' 10385009909Smillert 10485009909Smillertand then compile Perl. The places where fchdir() is used have 10585009909Smillertalternatives for systems that do not have fchdir() available. 10685009909Smillert 10785009909Smillert=head2 Perl on ILE 10885009909Smillert 10985009909SmillertThere exists a port of Perl to the ILE environment. This port, however, 11085009909Smillertis based quite an old release of Perl, Perl 5.00502 (August 1998). 11185009909Smillert(As of July 2002 the latest release of Perl is 5.8.0, and even 5.6.1 11285009909Smillerthas been out since April 2001.) If you need to run Perl on ILE, though, 113898184e3Ssthenyou may need this older port: L<http://www.cpan.org/ports/#os400> 11485009909SmillertNote that any Perl release later than 5.00502 has not been ported to ILE. 11585009909Smillert 11685009909SmillertIf you need to use Perl in the ILE environment, you may want to consider 11785009909Smillertusing Qp2RunPase() to call the PASE version of Perl. 11885009909Smillert 11985009909Smillert=head1 AUTHORS 12085009909Smillert 12185009909SmillertJarkko Hietaniemi <jhi@iki.fi> 12285009909SmillertBryan Logan <bryanlog@us.ibm.com> 12385009909SmillertDavid Larson <larson1@us.ibm.com> 12485009909Smillert 12585009909Smillert=cut 126