{
    "content": [
        {
            "type": "text",
            "text": "# PERLBS2000 (man)\n\n## NAME\n\nperlbs2000 - building and installing Perl for BS2000.  This document needs to be updated, but we don't know what it should say.  Please submit comments to <https://github.com/Perl/perl5/issues>.\n\n## SYNOPSIS\n\nThis document will help you Configure, build, test and install Perl on BS2000 in the POSIX\nsubsystem.\n\n## DESCRIPTION\n\nThis is a ported perl for the POSIX subsystem in BS2000 VERSION OSD V3.1A or later.  It may\nwork on other versions, but we started porting and testing it with 3.1A and are currently\nusing Version V4.0A.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (10 subsections)\n- **AUTHORS**\n- **SEE ALSO** (1 subsections)\n- **HISTORY**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "PERLBS2000",
        "section": "",
        "mode": "man",
        "summary": "perlbs2000 - building and installing Perl for BS2000.  This document needs to be updated, but we don't know what it should say.  Please submit comments to <https://github.com/Perl/perl5/issues>.",
        "synopsis": "This document will help you Configure, build, test and install Perl on BS2000 in the POSIX\nsubsystem.",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 6,
                "subsections": [
                    {
                        "name": "gzip on BS2000",
                        "lines": 3
                    },
                    {
                        "name": "bison on BS2000",
                        "lines": 5
                    },
                    {
                        "name": "Unpacking Perl Distribution on BS2000",
                        "lines": 15
                    },
                    {
                        "name": "Compiling Perl on BS2000",
                        "lines": 35
                    },
                    {
                        "name": "Testing Perl on BS2000",
                        "lines": 11
                    },
                    {
                        "name": "Installing Perl on BS2000",
                        "lines": 3
                    },
                    {
                        "name": "Using Perl in the Posix-Shell of BS2000",
                        "lines": 7
                    },
                    {
                        "name": "Using Perl in \"native\" BS2000",
                        "lines": 17
                    },
                    {
                        "name": "Floating point anomalies on BS2000",
                        "lines": 13
                    },
                    {
                        "name": "Using PerlIO and different encodings on ASCII and EBCDIC partitions",
                        "lines": 29
                    }
                ]
            },
            {
                "name": "AUTHORS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": [
                    {
                        "name": "Mailing list",
                        "lines": 12
                    }
                ]
            },
            {
                "name": "HISTORY",
                "lines": 7,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "perlbs2000 - building and installing Perl for BS2000.\n\nThis document needs to be updated, but we don't know what it should say.  Please submit\ncomments to <https://github.com/Perl/perl5/issues>.\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "This document will help you Configure, build, test and install Perl on BS2000 in the POSIX\nsubsystem.\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This is a ported perl for the POSIX subsystem in BS2000 VERSION OSD V3.1A or later.  It may\nwork on other versions, but we started porting and testing it with 3.1A and are currently\nusing Version V4.0A.\n\nYou may need the following GNU programs in order to install perl:\n",
                "subsections": [
                    {
                        "name": "gzip on BS2000",
                        "content": "We used version 1.2.4, which could be installed out of the box with one failure during 'make\ncheck'.\n"
                    },
                    {
                        "name": "bison on BS2000",
                        "content": "The yacc coming with BS2000 POSIX didn't work for us.  So we had to use bison.  We had to\nmake a few changes to perl in order to use the pure (reentrant) parser of bison.  We used\nversion 1.25, but we had to add a few changes due to EBCDIC.  See below for more details\nconcerning yacc.\n"
                    },
                    {
                        "name": "Unpacking Perl Distribution on BS2000",
                        "content": "To extract an ASCII tar archive on BS2000 POSIX you need an ASCII filesystem (we used the\nmountpoint /usr/local/ascii for this).  Now you extract the archive in the ASCII filesystem\nwithout I/O-conversion:\n\ncd /usr/local/ascii export IOCONVERSION=NO gunzip < /usr/local/src/perl.tar.gz | pax -r\n\nYou may ignore the error message for the first element of the archive (this doesn't look like\na tar archive / skipping to next file...), it's only the directory which will be created\nautomatically anyway.\n\nAfter extracting the archive you copy the whole directory tree to your EBCDIC filesystem.\nThis time you use I/O-conversion:\n\ncd /usr/local/src IOCONVERSION=YES cp -r /usr/local/ascii/perl5.00502 ./\n"
                    },
                    {
                        "name": "Compiling Perl on BS2000",
                        "content": "There is a \"hints\" file for BS2000 called hints.posix-bc (because posix-bc is the OS name\ngiven by `uname`) that specifies the correct values for most things.  The major problem is\n(of course) the EBCDIC character set.  We have german EBCDIC version.\n\nBecause of our problems with the native yacc we used GNU bison to generate a pure\n(=reentrant) parser for perly.y.  So our yacc is really the following script:\n\n-----8<-----/usr/local/bin/yacc-----8<----- #! /usr/bin/sh\n\n# Bison as a reentrant yacc:\n\n# save parameters: params=\"\" while [[ $# -gt 1 ]]; do\nparams=\"$params $1\"\nshift done\n\n# add flag %pureparser:\n\ntmpfile=/tmp/bison.$$.y echo %pureparser > $tmpfile cat $1 >> $tmpfile\n\n# call bison:\n\necho \"/usr/local/bin/bison --yacc $params $1\\t\\t\\t(Pure Parser)\" /usr/local/bin/bison --yacc\n$params $tmpfile\n\n# cleanup:\n\nrm -f $tmpfile -----8<----------8<-----\n\nWe still use the normal yacc for a2p.y though!!!  We made a softlink called byacc to\ndistinguish between the two versions:\n\nln -s /usr/bin/yacc /usr/local/bin/byacc\n\nWe build perl using GNU make.  We tried the native make once and it worked too.\n"
                    },
                    {
                        "name": "Testing Perl on BS2000",
                        "content": "We still got a few errors during \"make test\".  Some of them are the result of using bison.\nBison prints parser error instead of syntax error, so we may ignore them.  The following list\nshows our errors, your results may differ:\n\nop/numconvert.......FAILED tests 1409-1440 op/regexp...........FAILED tests 483, 496\nop/regexpnoamp.....FAILED tests 483, 496 pragma/overload.....FAILED tests 152-153, 170-171\npragma/warnings.....FAILED tests 14, 82, 129, 155, 192, 205, 207 lib/bigfloat........FAILED\ntests 351-352, 355 lib/bigfltpm........FAILED tests 354-355, 358 lib/complex.........FAILED\ntests 267, 487 lib/dumper..........FAILED tests 43, 45 Failed 11/231 test scripts, 95.24%\nokay. 57/10595 subtests failed, 99.46% okay.\n"
                    },
                    {
                        "name": "Installing Perl on BS2000",
                        "content": "We have no nroff on BS2000 POSIX (yet), so we ignored any errors while installing the\ndocumentation.\n"
                    },
                    {
                        "name": "Using Perl in the Posix-Shell of BS2000",
                        "content": "BS2000 POSIX doesn't support the shebang notation (\"#!/usr/local/bin/perl\"), so you have to\nuse the following lines instead:\n\n: # use perl\neval 'exec /usr/local/bin/perl -S $0 ${1+\"$@\"}'\nif 0; # ^ Run only under a shell\n"
                    },
                    {
                        "name": "Using Perl in \"native\" BS2000",
                        "content": "We don't have much experience with this yet, but try the following:\n\nCopy your Perl executable to a BS2000 LLM using bs2cp:\n\n\"bs2cp /usr/local/bin/perl 'bs2:perl(perl,l)'\"\n\nNow you can start it with the following (SDF) command:\n\n\"/START-PROG FROM-FILE=*MODULE(PERL,PERL),PROG-MODE=*ANY,RUN-MODE=*ADV\"\n\nFirst you get the BS2000 commandline prompt ('*').  Here you may enter your parameters, e.g.\n\"-e 'print \"Hello World!\\\\n\";'\" (note the double backslash!) or \"-w\" and the name of your\nPerl script.  Filenames starting with \"/\" are searched in the Posix filesystem, others are\nsearched in the BS2000 filesystem.  You may even use wildcards if you put a \"%\" in front of\nyour filename (e.g. \"-w checkfiles.pl %*.c\").  Read your C/C++ manual for additional\npossibilities of the commandline prompt (look for PARAMETER-PROMPTING).\n"
                    },
                    {
                        "name": "Floating point anomalies on BS2000",
                        "content": "There appears to be a bug in the floating point implementation on BS2000 POSIX systems such\nthat calling int() on the product of a number and a small magnitude number is not the same as\ncalling int() on the quotient of that number and a large magnitude number.  For example, in\nthe following Perl code:\n\nmy $x = 100000.0;\nmy $y = int($x * 1e-5) * 1e5; # '0'\nmy $z = int($x / 1e+5) * 1e5;  # '100000'\nprint \"\\$y is $y and \\$z is $z\\n\"; # $y is 0 and $z is 100000\n\nAlthough one would expect the quantities $y and $z to be the same and equal to 100000 they\nwill differ and instead will be 0 and 100000 respectively.\n"
                    },
                    {
                        "name": "Using PerlIO and different encodings on ASCII and EBCDIC partitions",
                        "content": "Since version 5.8 Perl uses the new PerlIO on BS2000.  This enables you using different\nencodings per IO channel.  For example you may use\n\nuse Encode;\nopen($f, \">:encoding(ascii)\", \"test.ascii\");\nprint $f \"Hello World!\\n\";\nopen($f, \">:encoding(posix-bc)\", \"test.ebcdic\");\nprint $f \"Hello World!\\n\";\nopen($f, \">:encoding(latin1)\", \"test.latin1\");\nprint $f \"Hello World!\\n\";\nopen($f, \">:encoding(utf8)\", \"test.utf8\");\nprint $f \"Hello World!\\n\";\n\nto get two files containing \"Hello World!\\n\" in ASCII, EBCDIC, ISO Latin-1 (in this example\nidentical to ASCII) respective UTF-EBCDIC (in this example identical to normal EBCDIC).  See\nthe documentation of Encode::PerlIO for details.\n\nAs the PerlIO layer uses raw IO internally, all this totally ignores the type of your\nfilesystem (ASCII or EBCDIC) and the IOCONVERSION environment variable.  If you want to get\nthe old behavior, that the BS2000 IO functions determine conversion depending on the\nfilesystem PerlIO still is your friend.  You use IOCONVERSION as usual and tell Perl, that\nit should use the native IO layer:\n\nexport IOCONVERSION=YES\nexport PERLIO=stdio\n\nNow your IO would be ASCII on ASCII partitions and EBCDIC on EBCDIC partitions.  See the\ndocumentation of PerlIO (without \"Encode::\"!)  for further possibilities.\n"
                    }
                ]
            },
            "AUTHORS": {
                "content": "Thomas Dorner\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "INSTALL, perlport.\n",
                "subsections": [
                    {
                        "name": "Mailing list",
                        "content": "If you are interested in the z/OS (formerly known as OS/390) and POSIX-BC (BS2000) ports of\nPerl then see the perl-mvs mailing list.  To subscribe, send an empty message to\nperl-mvs-subscribe@perl.org.\n\nSee also:\n\nhttps://lists.perl.org/list/perl-mvs.html\n\nThere are web archives of the mailing list at:\n\nhttps://www.nntp.perl.org/group/perl.mvs/\n"
                    }
                ]
            },
            "HISTORY": {
                "content": "This document was originally written by Thomas Dorner for the 5.005 release of Perl.\n\nThis document was podified for the 5.6 release of perl 11 July 2000.\n\n\n\nperl v5.34.0                                 2025-07-25                                PERLBS2000(1)",
                "subsections": []
            }
        }
    }
}