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