1PERLBS2000(1) Perl Programmers Reference Guide PERLBS2000(1)
2
3
4
6 perlbs2000 - building and installing Perl for BS2000.
7
8 This document needs to be updated, but we don't know what it should
9 say. Please submit comments to <https://github.com/Perl/perl5/issues>.
10
12 This document will help you Configure, build, test and install Perl on
13 BS2000 in the POSIX subsystem.
14
16 This is a ported perl for the POSIX subsystem in BS2000 VERSION OSD
17 V3.1A or later. It may work on other versions, but we started porting
18 and testing it with 3.1A and are currently using Version V4.0A.
19
20 You may need the following GNU programs in order to install perl:
21
22 gzip on BS2000
23 We used version 1.2.4, which could be installed out of the box with one
24 failure during 'make check'.
25
26 bison on BS2000
27 The yacc coming with BS2000 POSIX didn't work for us. So we had to use
28 bison. We had to make a few changes to perl in order to use the pure
29 (reentrant) parser of bison. We used version 1.25, but we had to add a
30 few changes due to EBCDIC. See below for more details concerning yacc.
31
32 Unpacking Perl Distribution on BS2000
33 To extract an ASCII tar archive on BS2000 POSIX you need an ASCII
34 filesystem (we used the mountpoint /usr/local/ascii for this). Now you
35 extract the archive in the ASCII filesystem without I/O-conversion:
36
37 cd /usr/local/ascii export IO_CONVERSION=NO gunzip <
38 /usr/local/src/perl.tar.gz | pax -r
39
40 You may ignore the error message for the first element of the archive
41 (this doesn't look like a tar archive / skipping to next file...), it's
42 only the directory which will be created automatically anyway.
43
44 After extracting the archive you copy the whole directory tree to your
45 EBCDIC filesystem. This time you use I/O-conversion:
46
47 cd /usr/local/src IO_CONVERSION=YES cp -r /usr/local/ascii/perl5.005_02
48 ./
49
50 Compiling Perl on BS2000
51 There is a "hints" file for BS2000 called hints.posix-bc (because
52 posix-bc is the OS name given by `uname`) that specifies the correct
53 values for most things. The major problem is (of course) the EBCDIC
54 character set. We have german EBCDIC version.
55
56 Because of our problems with the native yacc we used GNU bison to
57 generate a pure (=reentrant) parser for perly.y. So our yacc is really
58 the following script:
59
60 -----8<-----/usr/local/bin/yacc-----8<----- #! /usr/bin/sh
61
62 # Bison as a reentrant yacc:
63
64 # save parameters: params="" while [[ $# -gt 1 ]]; do
65 params="$params $1"
66 shift done
67
68 # add flag %pure_parser:
69
70 tmpfile=/tmp/bison.$$.y echo %pure_parser > $tmpfile cat $1 >> $tmpfile
71
72 # call bison:
73
74 echo "/usr/local/bin/bison --yacc $params $1\t\t\t(Pure Parser)"
75 /usr/local/bin/bison --yacc $params $tmpfile
76
77 # cleanup:
78
79 rm -f $tmpfile -----8<----------8<-----
80
81 We still use the normal yacc for a2p.y though!!! We made a softlink
82 called byacc to distinguish between the two versions:
83
84 ln -s /usr/bin/yacc /usr/local/bin/byacc
85
86 We build perl using GNU make. We tried the native make once and it
87 worked too.
88
89 Testing Perl on BS2000
90 We still got a few errors during "make test". Some of them are the
91 result of using bison. Bison prints parser error instead of syntax
92 error, so we may ignore them. The following list shows our errors,
93 your results may differ:
94
95 op/numconvert.......FAILED tests 1409-1440 op/regexp...........FAILED
96 tests 483, 496 op/regexp_noamp.....FAILED tests 483, 496
97 pragma/overload.....FAILED tests 152-153, 170-171
98 pragma/warnings.....FAILED tests 14, 82, 129, 155, 192, 205, 207
99 lib/bigfloat........FAILED tests 351-352, 355
100 lib/bigfltpm........FAILED tests 354-355, 358
101 lib/complex.........FAILED tests 267, 487 lib/dumper..........FAILED
102 tests 43, 45 Failed 11/231 test scripts, 95.24% okay. 57/10595 subtests
103 failed, 99.46% okay.
104
105 Installing Perl on BS2000
106 We have no nroff on BS2000 POSIX (yet), so we ignored any errors while
107 installing the documentation.
108
109 Using Perl in the Posix-Shell of BS2000
110 BS2000 POSIX doesn't support the shebang notation
111 ("#!/usr/local/bin/perl"), so you have to use the following lines
112 instead:
113
114 : # use perl
115 eval 'exec /usr/local/bin/perl -S $0 ${1+"$@"}'
116 if 0; # ^ Run only under a shell
117
118 Using Perl in "native" BS2000
119 We don't have much experience with this yet, but try the following:
120
121 Copy your Perl executable to a BS2000 LLM using bs2cp:
122
123 "bs2cp /usr/local/bin/perl 'bs2:perl(perl,l)'"
124
125 Now you can start it with the following (SDF) command:
126
127 "/START-PROG FROM-FILE=*MODULE(PERL,PERL),PROG-MODE=*ANY,RUN-MODE=*ADV"
128
129 First you get the BS2000 commandline prompt ('*'). Here you may enter
130 your parameters, e.g. "-e 'print "Hello World!\\n";'" (note the double
131 backslash!) or "-w" and the name of your Perl script. Filenames
132 starting with "/" are searched in the Posix filesystem, others are
133 searched in the BS2000 filesystem. You may even use wildcards if you
134 put a "%" in front of your filename (e.g. "-w checkfiles.pl %*.c").
135 Read your C/C++ manual for additional possibilities of the commandline
136 prompt (look for PARAMETER-PROMPTING).
137
138 Floating point anomalies on BS2000
139 There appears to be a bug in the floating point implementation on
140 BS2000 POSIX systems such that calling int() on the product of a number
141 and a small magnitude number is not the same as calling int() on the
142 quotient of that number and a large magnitude number. For example, in
143 the following Perl code:
144
145 my $x = 100000.0;
146 my $y = int($x * 1e-5) * 1e5; # '0'
147 my $z = int($x / 1e+5) * 1e5; # '100000'
148 print "\$y is $y and \$z is $z\n"; # $y is 0 and $z is 100000
149
150 Although one would expect the quantities $y and $z to be the same and
151 equal to 100000 they will differ and instead will be 0 and 100000
152 respectively.
153
154 Using PerlIO and different encodings on ASCII and EBCDIC partitions
155 Since version 5.8 Perl uses the new PerlIO on BS2000. This enables you
156 using different encodings per IO channel. For example you may use
157
158 use Encode;
159 open($f, ">:encoding(ascii)", "test.ascii");
160 print $f "Hello World!\n";
161 open($f, ">:encoding(posix-bc)", "test.ebcdic");
162 print $f "Hello World!\n";
163 open($f, ">:encoding(latin1)", "test.latin1");
164 print $f "Hello World!\n";
165 open($f, ">:encoding(utf8)", "test.utf8");
166 print $f "Hello World!\n";
167
168 to get two files containing "Hello World!\n" in ASCII, EBCDIC, ISO
169 Latin-1 (in this example identical to ASCII) respective UTF-EBCDIC (in
170 this example identical to normal EBCDIC). See the documentation of
171 Encode::PerlIO for details.
172
173 As the PerlIO layer uses raw IO internally, all this totally ignores
174 the type of your filesystem (ASCII or EBCDIC) and the IO_CONVERSION
175 environment variable. If you want to get the old behavior, that the
176 BS2000 IO functions determine conversion depending on the filesystem
177 PerlIO still is your friend. You use IO_CONVERSION as usual and tell
178 Perl, that it should use the native IO layer:
179
180 export IO_CONVERSION=YES
181 export PERLIO=stdio
182
183 Now your IO would be ASCII on ASCII partitions and EBCDIC on EBCDIC
184 partitions. See the documentation of PerlIO (without "Encode::"!) for
185 further possibilities.
186
188 Thomas Dorner
189
191 INSTALL, perlport.
192
193 Mailing list
194 If you are interested in the z/OS (formerly known as OS/390) and POSIX-
195 BC (BS2000) ports of Perl then see the perl-mvs mailing list. To
196 subscribe, send an empty message to perl-mvs-subscribe@perl.org.
197
198 See also:
199
200 https://lists.perl.org/list/perl-mvs.html
201
202 There are web archives of the mailing list at:
203
204 https://www.nntp.perl.org/group/perl.mvs/
205
207 This document was originally written by Thomas Dorner for the 5.005
208 release of Perl.
209
210 This document was podified for the 5.6 release of perl 11 July 2000.
211
212
213
214perl v5.36.3 2023-11-30 PERLBS2000(1)