Debian Codegraph @

upstream/debian-unstable/man1/perlbs2000.1

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\" ========================================================================
56 .\"
57 .IX Title "PERLBS2000 1"
58 .TH PERLBS2000 1 2025-11-16 "perl v5.40.1" "Perl Programmers Reference Guide"
59 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
60 .\" way too many mistakes in technical documents.
61 .if n .ad l
62 .nh
63 .SH NAME
64 perlbs2000 \- building and installing Perl for BS2000.
65 .PP
66 This document needs to be updated, but we don't know what it should say.
67 Please submit comments to <https://github.com/Perl/perl5/issues>.
68 .SH SYNOPSIS
69 .IX Header "SYNOPSIS"
70 This document will help you Configure, build, test and install Perl
71 on BS2000 in the POSIX subsystem.
72 .SH DESCRIPTION
73 .IX Header "DESCRIPTION"
74 This is a ported perl for the POSIX subsystem in BS2000 VERSION OSD
75 V3.1A or later. It may work on other versions, but we started porting
76 and testing it with 3.1A and are currently using Version V4.0A.
77 .PP
78 You may need the following GNU programs in order to install perl:
79 .SS "gzip on BS2000"
80 .IX Subsection "gzip on BS2000"
81 We used version 1.2.4, which could be installed out of the box with
82 one failure during 'make check'.
83 .SS "bison on BS2000"
84 .IX Subsection "bison on BS2000"
85 The yacc coming with BS2000 POSIX didn't work for us. So we had to
86 use bison. We had to make a few changes to perl in order to use the
87 pure (reentrant) parser of bison. We used version 1.25, but we had to
88 add a few changes due to EBCDIC. See below for more details
89 concerning yacc.
90 .SS "Unpacking Perl Distribution on BS2000"
91 .IX Subsection "Unpacking Perl Distribution on BS2000"
92 To extract an ASCII tar archive on BS2000 POSIX you need an ASCII
93 filesystem (we used the mountpoint /usr/local/ascii for this). Now
94 you extract the archive in the ASCII filesystem without
95 I/O\-conversion:
96 .PP
97 cd /usr/local/ascii
98 export IO_CONVERSION=NO
99 gunzip < /usr/local/src/perl.tar.gz | pax \-r
100 .PP
101 You may ignore the error message for the first element of the archive
102 (this doesn't look like a tar archive / skipping to next file...),
103 it's only the directory which will be created automatically anyway.
104 .PP
105 After extracting the archive you copy the whole directory tree to your
106 EBCDIC filesystem. \fBThis time you use I/O\-conversion\fR:
107 .PP
108 cd /usr/local/src
109 IO_CONVERSION=YES
110 cp \-r /usr/local/ascii/perl5.005_02 ./
111 .SS "Compiling Perl on BS2000"
112 .IX Subsection "Compiling Perl on BS2000"
113 There is a "hints" file for BS2000 called hints.posix\-bc (because
114 posix-bc is the OS name given by `uname`) that specifies the correct
115 values for most things. The major problem is (of course) the EBCDIC
116 character set. We have german EBCDIC version.
117 .PP
118 Because of our problems with the native yacc we used GNU bison to
119 generate a pure (=reentrant) parser for perly.y. So our yacc is
120 really the following script:
121 .PP
122 \&\-\-\-\-\-8<\-\-\-\-\-/usr/local/bin/yacc\-\-\-\-\-8<\-\-\-\-\-
123 #! /usr/bin/sh
124 .PP
125 # Bison as a reentrant yacc:
126 .PP
127 # save parameters:
128 params=""
129 while [[ $# \-gt 1 ]]; do
130 params="$params \f(CW$1\fR"
131 shift
132 done
133 .PP
134 # add flag \f(CW%pure_parser:\fR
135 .PP
136 tmpfile=/tmp/bison.$$.y
137 echo \f(CW%pure_parser\fR > \f(CW$tmpfile\fR
138 cat \f(CW$1\fR >> \f(CW$tmpfile\fR
139 .PP
140 # call bison:
141 .PP
142 echo "/usr/local/bin/bison \-\-yacc \f(CW$params\fR \f(CW$1\fR\et\et\et(Pure Parser)"
143 /usr/local/bin/bison \-\-yacc \f(CW$params\fR \f(CW$tmpfile\fR
144 .PP
145 # cleanup:
146 .PP
147 rm \-f \f(CW$tmpfile\fR
148 \&\-\-\-\-\-8<\-\-\-\-\-\-\-\-\-\-8<\-\-\-\-\-
149 .PP
150 We still use the normal yacc for a2p.y though!!! We made a softlink
151 called byacc to distinguish between the two versions:
152 .PP
153 ln \-s /usr/bin/yacc /usr/local/bin/byacc
154 .PP
155 We build perl using GNU make. We tried the native make once and it
156 worked too.
157 .SS "Testing Perl on BS2000"
158 .IX Subsection "Testing Perl on BS2000"
159 We still got a few errors during \f(CW\*(C`make test\*(C'\fR. Some of them are the
160 result of using bison. Bison prints \fIparser error\fR instead of \fIsyntax
161 error\fR, so we may ignore them. The following list shows
162 our errors, your results may differ:
163 .PP
164 op/numconvert.......FAILED tests 1409\-1440
165 op/regexp...........FAILED tests 483, 496
166 op/regexp_noamp.....FAILED tests 483, 496
167 pragma/overload.....FAILED tests 152\-153, 170\-171
168 pragma/warnings.....FAILED tests 14, 82, 129, 155, 192, 205, 207
169 lib/bigfloat........FAILED tests 351\-352, 355
170 lib/bigfltpm........FAILED tests 354\-355, 358
171 lib/complex.........FAILED tests 267, 487
172 lib/dumper..........FAILED tests 43, 45
173 Failed 11/231 test scripts, 95.24% okay. 57/10595 subtests failed, 99.46% okay.
174 .SS "Installing Perl on BS2000"
175 .IX Subsection "Installing Perl on BS2000"
176 We have no nroff on BS2000 POSIX (yet), so we ignored any errors while
177 installing the documentation.
178 .SS "Using Perl in the Posix-Shell of BS2000"
179 .IX Subsection "Using Perl in the Posix-Shell of BS2000"
180 BS2000 POSIX doesn't support the shebang notation
181 (\f(CW\*(C`#!/usr/local/bin/perl\*(C'\fR), so you have to use the following lines
182 instead:
183 .PP
184 : # use perl
185 eval 'exec /usr/local/bin/perl \-S \f(CW$0\fR ${1+"$@"}'
186 if 0; # ^ Run only under a shell
187 .SS "Using Perl in ""native"" BS2000"
188 .IX Subsection "Using Perl in ""native"" BS2000"
189 We don't have much experience with this yet, but try the following:
190 .PP
191 Copy your Perl executable to a BS2000 LLM using bs2cp:
192 .PP
193 \&\f(CW\*(C`bs2cp /usr/local/bin/perl \*(Aqbs2:perl(perl,l)\*(Aq\*(C'\fR
194 .PP
195 Now you can start it with the following (SDF) command:
196 .PP
197 \&\f(CW\*(C`/START\-PROG FROM\-FILE=*MODULE(PERL,PERL),PROG\-MODE=*ANY,RUN\-MODE=*ADV\*(C'\fR
198 .PP
199 First you get the BS2000 commandline prompt ('*'). Here you may enter
200 your parameters, e.g. \f(CW\*(C`\-e \*(Aqprint "Hello World!\e\en";\*(Aq\*(C'\fR (note the
201 double backslash!) or \f(CW\*(C`\-w\*(C'\fR and the name of your Perl script.
202 Filenames starting with \f(CW\*(C`/\*(C'\fR are searched in the Posix filesystem,
203 others are searched in the BS2000 filesystem. You may even use
204 wildcards if you put a \f(CW\*(C`%\*(C'\fR in front of your filename (e.g. \f(CW\*(C`\-w
205 checkfiles.pl %*.c\*(C'\fR). Read your C/C++ manual for additional
206 possibilities of the commandline prompt (look for
207 PARAMETER-PROMPTING).
208 .SS "Floating point anomalies on BS2000"
209 .IX Subsection "Floating point anomalies on BS2000"
210 There appears to be a bug in the floating point implementation on BS2000 POSIX
211 systems such that calling \fBint()\fR on the product of a number and a small
212 magnitude number is not the same as calling \fBint()\fR on the quotient of
213 that number and a large magnitude number. For example, in the following
214 Perl code:
215 .PP
216 .Vb 4
217 \& my $x = 100000.0;
218 \& my $y = int($x * 1e\-5) * 1e5; # \*(Aq0\*(Aq
219 \& my $z = int($x / 1e+5) * 1e5; # \*(Aq100000\*(Aq
220 \& print "\e$y is $y and \e$z is $z\en"; # $y is 0 and $z is 100000
221 .Ve
222 .PP
223 Although one would expect the quantities \f(CW$y\fR and \f(CW$z\fR to be the same and equal
224 to 100000 they will differ and instead will be 0 and 100000 respectively.
225 .SS "Using PerlIO and different encodings on ASCII and EBCDIC partitions"
226 .IX Subsection "Using PerlIO and different encodings on ASCII and EBCDIC partitions"
227 Since version 5.8 Perl uses the new PerlIO on BS2000. This enables
228 you using different encodings per IO channel. For example you may use
229 .PP
230 .Vb 9
231 \& use Encode;
232 \& open($f, ">:encoding(ascii)", "test.ascii");
233 \& print $f "Hello World!\en";
234 \& open($f, ">:encoding(posix\-bc)", "test.ebcdic");
235 \& print $f "Hello World!\en";
236 \& open($f, ">:encoding(latin1)", "test.latin1");
237 \& print $f "Hello World!\en";
238 \& open($f, ">:encoding(utf8)", "test.utf8");
239 \& print $f "Hello World!\en";
240 .Ve
241 .PP
242 to get two files containing "Hello World!\en" in ASCII, EBCDIC, ISO
243 Latin\-1 (in this example identical to ASCII) respective UTF-EBCDIC (in
244 this example identical to normal EBCDIC). See the documentation of
245 Encode::PerlIO for details.
246 .PP
247 As the PerlIO layer uses raw IO internally, all this totally ignores
248 the type of your filesystem (ASCII or EBCDIC) and the IO_CONVERSION
249 environment variable. If you want to get the old behavior, that the
250 BS2000 IO functions determine conversion depending on the filesystem
251 PerlIO still is your friend. You use IO_CONVERSION as usual and tell
252 Perl, that it should use the native IO layer:
253 .PP
254 .Vb 2
255 \& export IO_CONVERSION=YES
256 \& export PERLIO=stdio
257 .Ve
258 .PP
259 Now your IO would be ASCII on ASCII partitions and EBCDIC on EBCDIC
260 partitions. See the documentation of PerlIO (without \f(CW\*(C`Encode::\*(C'\fR!)
261 for further possibilities.
262 .SH AUTHORS
263 .IX Header "AUTHORS"
264 Thomas Dorner
265 .SH "SEE ALSO"
266 .IX Header "SEE ALSO"
267 INSTALL, perlport.
268 .SS "Mailing list"
269 .IX Subsection "Mailing list"
270 If you are interested in the z/OS (formerly known as OS/390)
271 and POSIX-BC (BS2000) ports of Perl then see the perl-mvs mailing list.
272 To subscribe, send an empty message to perl\-mvs\[email protected].
273 .PP
274 See also:
275 .PP
276 .Vb 1
277 \& https://lists.perl.org/list/perl\-mvs.html
278 .Ve
279 .PP
280 There are web archives of the mailing list at:
281 .PP
282 .Vb 1
283 \& https://www.nntp.perl.org/group/perl.mvs/
284 .Ve
285 .SH HISTORY
286 .IX Header "HISTORY"
287 This document was originally written by Thomas Dorner for the 5.005
288 release of Perl.
289 .PP
290 This document was podified for the 5.6 release of perl 11 July 2000.