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