Debian Codegraph @

upstream/fedora-44/man1/perlbs2000.1

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