1PERLBS2000(1)          Perl Programmers Reference Guide          PERLBS2000(1)
2
3
4

NAME

6       README.BS2000 - building and installing Perl for BS2000.
7

SYNOPSIS

9       This document will help you Configure, build, test and install Perl on
10       BS2000 in the POSIX subsystem.
11

DESCRIPTION

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
21       We used version 1.2.4, which could be installed out of the box with one
22       failure during 'make check'.
23
24       bison on BS2000
25
26       The yacc coming with BS2000 POSIX didn't work for us.  So we had to use
27       bison.  We had to make a few changes to perl in order to use the pure
28       (reentrant) parser of bison.  We used version 1.25, but we had to add a
29       few changes due to EBCDIC.  See below for more details concerning yacc.
30
31       Unpacking Perl Distribution on BS2000
32
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
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 gen‐
58       erate 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
92       We still got a few errors during "make test".  Some of them are the
93       result of using bison.  Bison prints parser error instead of syntax
94       error, so we may ignore them.  The following list shows our errors,
95       your results may differ:
96
97       op/numconvert.......FAILED tests 1409-1440 op/regexp...........FAILED
98       tests 483, 496 op/regexp_noamp.....FAILED tests 483, 496 pragma/over‐
99       load.....FAILED tests 152-153, 170-171 pragma/warnings.....FAILED tests
100       14, 82, 129, 155, 192, 205, 207 lib/bigfloat........FAILED tests
101       351-352, 355 lib/bigfltpm........FAILED tests 354-355, 358 lib/com‐
102       plex.........FAILED tests 267, 487 lib/dumper..........FAILED tests 43,
103       45 Failed 11/231 test scripts, 95.24% okay. 57/10595 subtests failed,
104       99.46% okay.
105
106       Installing Perl on BS2000
107
108       We have no nroff on BS2000 POSIX (yet), so we ignored any errors while
109       installing the documentation.
110
111       Using Perl in the Posix-Shell of BS2000
112
113       BS2000 POSIX doesn't support the shebang notation
114       ("#!/usr/local/bin/perl"), so you have to use the following lines
115       instead:
116
117       : # use perl
118           eval 'exec /usr/local/bin/perl -S $0 ${1+"$@"}'
119               if $running_under_some_shell;
120
121       Using Perl in "native" BS2000
122
123       We don't have much experience with this yet, but try the following:
124
125       Copy your Perl executable to a BS2000 LLM using bs2cp:
126
127       "bs2cp /usr/local/bin/perl 'bs2:perl(perl,l)'"
128
129       Now you can start it with the following (SDF) command:
130
131       "/START-PROG FROM-FILE=*MODULE(PERL,PERL),PROG-MODE=*ANY,RUN-MODE=*ADV"
132
133       First you get the BS2000 commandline prompt ('*').  Here you may enter
134       your parameters, e.g. "-e 'print "Hello World!\\n";'" (note the double
135       backslash!) or "-w" and the name of your Perl script.  Filenames start‐
136       ing with "/" are searched in the Posix filesystem, others are searched
137       in the BS2000 filesystem.  You may even use wildcards if you put a "%"
138       in front of your filename (e.g. "-w checkfiles.pl %*.c").  Read your
139       C/C++ manual for additional possibilities of the commandline prompt
140       (look for PARAMETER-PROMPTING).
141
142       Floating point anomalies on BS2000
143
144       There appears to be a bug in the floating point implementation on
145       BS2000 POSIX systems such that calling int() on the product of a number
146       and a small magnitude number is not the same as calling int() on the
147       quotient of that number and a large magnitude number.  For example, in
148       the following Perl code:
149
150           my $x = 100000.0;
151           my $y = int($x * 1e-5) * 1e5; # '0'
152           my $z = int($x / 1e+5) * 1e5;  # '100000'
153           print "\$y is $y and \$z is $z\n"; # $y is 0 and $z is 100000
154
155       Although one would expect the quantities $y and $z to be the same and
156       equal to 100000 they will differ and instead will be 0 and 100000
157       respectively.
158
159       Using PerlIO and different encodings on ASCII and EBCDIC partitions
160
161       Since version 5.8 Perl uses the new PerlIO on BS2000.  This enables you
162       using different encodings per IO channel.  For example you may use
163
164           use Encode;
165           open($f, ">:encoding(ascii)", "test.ascii");
166           print $f "Hello World!\n";
167           open($f, ">:encoding(posix-bc)", "test.ebcdic");
168           print $f "Hello World!\n";
169           open($f, ">:encoding(latin1)", "test.latin1");
170           print $f "Hello World!\n";
171           open($f, ">:encoding(utf8)", "test.utf8");
172           print $f "Hello World!\n";
173
174       to get two files containing "Hello World!\n" in ASCII, EBCDIC, ISO
175       Latin-1 (in this example identical to ASCII) respective UTF-EBCDIC (in
176       this example identical to normal EBCDIC).  See the documentation of
177       Encode::PerlIO for details.
178
179       As the PerlIO layer uses raw IO internally, all this totally ignores
180       the type of your filesystem (ASCII or EBCDIC) and the IO_CONVERSION
181       environment variable.  If you want to get the old behavior, that the
182       BS2000 IO functions determine conversion depending on the filesystem
183       PerlIO still is your friend.  You use IO_CONVERSION as usual and tell
184       Perl, that it should use the native IO layer:
185
186           export IO_CONVERSION=YES
187           export PERLIO=stdio
188
189       Now your IO would be ASCII on ASCII partitions and EBCDIC on EBCDIC
190       partitions.  See the documentation of PerlIO (without "Encode::"!)  for
191       further posibilities.
192

AUTHORS

194       Thomas Dorner
195

SEE ALSO

197       INSTALL, perlport.
198
199       Mailing list
200
201       If you are interested in the VM/ESA, z/OS (formerly known as OS/390)
202       and POSIX-BC (BS2000) ports of Perl then see the perl-mvs mailing list.
203       To subscribe, send an empty message to perl-mvs-subscribe@perl.org.
204
205       See also:
206
207           http://lists.perl.org/showlist.cgi?name=perl-mvs
208
209       There are web archives of the mailing list at:
210
211           http://www.xray.mpe.mpg.de/mailing-lists/perl-mvs/
212           http://archive.develooper.com/perl-mvs@perl.org/
213

HISTORY

215       This document was originally written by Thomas Dorner for the 5.005
216       release of Perl.
217
218       This document was podified for the 5.6 release of perl 11 July 2000.
219
220
221
222perl v5.8.8                       2006-01-07                     PERLBS2000(1)
Impressum