{
    "content": [
        {
            "type": "text",
            "text": "# perlos2 (man)\n\n## NAME\n\nperlos2 - Perl under OS/2, DOS, Win0.3*, Win0.95 and WinNT.\n\n## SYNOPSIS\n\nOne can read this document in the following formats:\nman perlos2\nview perl perlos2\nexplorer perlos2.html\ninfo perlos2\nto list some (not all may be available simultaneously), or it may be read as is: either as\nREADME.os2, or pod/perlos2.pod.\nTo read the .INF version of documentation (very recommended) outside of OS/2, one needs an\nIBM's reader (may be available on IBM ftp sites (?)  (URL anyone?)) or shipped with PC DOS\n7.0 and IBM's Visual Age C++ 3.5.\nA copy of a Win* viewer is contained in the \"Just add OS/2 Warp\" package\nftp://ftp.software.ibm.com/ps/products/os2/tools/jaow/jaow.zip\nin ?:\\JUSTADD\\view.exe. This gives one an access to EMX's .INF docs as well (text form is\navailable in /emx/doc in EMX's distribution).  There is also a different viewer named xview.\nNote that if you have lynx.exe or netscape.exe installed, you can follow WWW links from this\ndocument in .INF format. If you have EMX docs installed correctly, you can follow library\nlinks (you need to have \"view emxbook\" working by setting \"EMXBOOK\" environment variable as\nit is described in EMX docs).\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (10 subsections)\n- **INSTALLATION** (9 subsections)\n- **BUILD** (10 subsections)\n- **Building custom .EXE files** (27 subsections)\n- **ENVIRONMENT** (1 subsections)\n- **Evolution** (9 subsections)\n- **BUGS**\n- **AUTHOR**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "perlos2",
        "section": "",
        "mode": "man",
        "summary": "perlos2 - Perl under OS/2, DOS, Win0.3*, Win0.95 and WinNT.",
        "synopsis": "One can read this document in the following formats:\nman perlos2\nview perl perlos2\nexplorer perlos2.html\ninfo perlos2\nto list some (not all may be available simultaneously), or it may be read as is: either as\nREADME.os2, or pod/perlos2.pod.\nTo read the .INF version of documentation (very recommended) outside of OS/2, one needs an\nIBM's reader (may be available on IBM ftp sites (?)  (URL anyone?)) or shipped with PC DOS\n7.0 and IBM's Visual Age C++ 3.5.\nA copy of a Win* viewer is contained in the \"Just add OS/2 Warp\" package\nftp://ftp.software.ibm.com/ps/products/os2/tools/jaow/jaow.zip\nin ?:\\JUSTADD\\view.exe. This gives one an access to EMX's .INF docs as well (text form is\navailable in /emx/doc in EMX's distribution).  There is also a different viewer named xview.\nNote that if you have lynx.exe or netscape.exe installed, you can follow WWW links from this\ndocument in .INF format. If you have EMX docs installed correctly, you can follow library\nlinks (you need to have \"view emxbook\" working by setting \"EMXBOOK\" environment variable as\nit is described in EMX docs).",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [
            {
                "name": "perl",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/perl/1/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 26,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 1,
                "subsections": [
                    {
                        "name": "Target",
                        "lines": 28
                    },
                    {
                        "name": "Other OSes",
                        "lines": 10
                    },
                    {
                        "name": "Prerequisites",
                        "lines": 62
                    },
                    {
                        "name": "Starting Perl programs under OS/2 (and DOS and...)",
                        "lines": 46
                    },
                    {
                        "name": "Starting OS/2 (and DOS) programs under Perl",
                        "lines": 68
                    },
                    {
                        "name": "Frequently asked questions",
                        "lines": 1
                    },
                    {
                        "name": "\"It does not work\"",
                        "lines": 4
                    },
                    {
                        "name": "I cannot run external programs",
                        "lines": 22
                    },
                    {
                        "name": "\"``\" and pipe-\"open\" do not work under DOS.",
                        "lines": 7
                    },
                    {
                        "name": "Cannot start \"find.exe \"pattern\" file\"",
                        "lines": 18
                    }
                ]
            },
            {
                "name": "INSTALLATION",
                "lines": 1,
                "subsections": [
                    {
                        "name": "Automatic binary installation",
                        "lines": 14
                    },
                    {
                        "name": "Things not taken care of by automatic binary installation:",
                        "lines": 18
                    },
                    {
                        "name": "Manual binary installation",
                        "lines": 101
                    },
                    {
                        "name": "Warning",
                        "lines": 4
                    },
                    {
                        "name": "Accessing documentation",
                        "lines": 24
                    },
                    {
                        "name": "Plain text",
                        "lines": 12
                    },
                    {
                        "name": "Manpages",
                        "lines": 36
                    },
                    {
                        "name": "GNU \"info\" files",
                        "lines": 6
                    },
                    {
                        "name": "\"LaTeX\" docs",
                        "lines": 2
                    }
                ]
            },
            {
                "name": "BUILD",
                "lines": 2,
                "subsections": [
                    {
                        "name": "The short story",
                        "lines": 24
                    },
                    {
                        "name": "Prerequisites",
                        "lines": 56
                    },
                    {
                        "name": "Getting perl source",
                        "lines": 25
                    },
                    {
                        "name": "Application of the patches",
                        "lines": 9
                    },
                    {
                        "name": "Hand-editing",
                        "lines": 3
                    },
                    {
                        "name": "Making",
                        "lines": 18
                    },
                    {
                        "name": "Testing",
                        "lines": 49
                    },
                    {
                        "name": "Installing the built perl",
                        "lines": 22
                    },
                    {
                        "name": "\"a.out\"-style build",
                        "lines": 18
                    },
                    {
                        "name": "Building a binary distribution",
                        "lines": 174
                    }
                ]
            },
            {
                "name": "Building custom .EXE files",
                "lines": 3,
                "subsections": [
                    {
                        "name": "Making executables with a custom collection of statically loaded extensions",
                        "lines": 31
                    },
                    {
                        "name": "Making executables with a custom search-paths",
                        "lines": 166
                    },
                    {
                        "name": "Build FAQ",
                        "lines": 1
                    },
                    {
                        "name": "Some \"/\" became \"\\\" in pdksh.",
                        "lines": 2
                    },
                    {
                        "name": "'errno' - unresolved external",
                        "lines": 2
                    },
                    {
                        "name": "Problems with tr or sed",
                        "lines": 2
                    },
                    {
                        "name": "Some problem (forget which ;-)",
                        "lines": 2
                    },
                    {
                        "name": "Library ... not found",
                        "lines": 2
                    },
                    {
                        "name": "Segfault in make",
                        "lines": 2
                    },
                    {
                        "name": "op/sprintf test failure",
                        "lines": 2
                    },
                    {
                        "name": "Specific (mis)features of OS/2 port",
                        "lines": 1
                    },
                    {
                        "name": "\"setpriority\", \"getpriority\"",
                        "lines": 8
                    },
                    {
                        "name": "\"system()\"",
                        "lines": 38
                    },
                    {
                        "name": "\"extproc\" on the first line",
                        "lines": 4
                    },
                    {
                        "name": "Additional modules:",
                        "lines": 8
                    },
                    {
                        "name": "Prebuilt methods:",
                        "lines": 64
                    },
                    {
                        "name": "OS2::SysInfo()",
                        "lines": 11
                    },
                    {
                        "name": "OS2::BootDrive()",
                        "lines": 46
                    },
                    {
                        "name": "Prebuilt variables:",
                        "lines": 23
                    },
                    {
                        "name": "Misfeatures",
                        "lines": 62
                    },
                    {
                        "name": "Modifications",
                        "lines": 22
                    },
                    {
                        "name": "Identifying DLLs",
                        "lines": 4
                    },
                    {
                        "name": "Centralized management of resources",
                        "lines": 122
                    },
                    {
                        "name": "Perl flavors",
                        "lines": 61
                    },
                    {
                        "name": "Why strange names?",
                        "lines": 6
                    },
                    {
                        "name": "Why dynamic linking?",
                        "lines": 48
                    },
                    {
                        "name": "Why chimera build?",
                        "lines": 16
                    }
                ]
            },
            {
                "name": "ENVIRONMENT",
                "lines": 54,
                "subsections": [
                    {
                        "name": "\"TMP\" or \"TEMP\"",
                        "lines": 2
                    }
                ]
            },
            {
                "name": "Evolution",
                "lines": 2,
                "subsections": [
                    {
                        "name": "Text-mode filehandles",
                        "lines": 9
                    },
                    {
                        "name": "Priorities",
                        "lines": 3
                    },
                    {
                        "name": "DLL name mangling: pre 5.6.2",
                        "lines": 18
                    },
                    {
                        "name": "DLL name mangling: 5.6.2 and beyond",
                        "lines": 70
                    },
                    {
                        "name": "DLL forwarder generation",
                        "lines": 22
                    },
                    {
                        "name": "Threading",
                        "lines": 7
                    },
                    {
                        "name": "Calls to external programs",
                        "lines": 48
                    },
                    {
                        "name": "Memory allocation",
                        "lines": 11
                    },
                    {
                        "name": "Threads",
                        "lines": 17
                    }
                ]
            },
            {
                "name": "BUGS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "perlos2 - Perl under OS/2, DOS, Win0.3*, Win0.95 and WinNT.\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "One can read this document in the following formats:\n\nman perlos2\nview perl perlos2\nexplorer perlos2.html\ninfo perlos2\n\nto list some (not all may be available simultaneously), or it may be read as is: either as\nREADME.os2, or pod/perlos2.pod.\n\nTo read the .INF version of documentation (very recommended) outside of OS/2, one needs an\nIBM's reader (may be available on IBM ftp sites (?)  (URL anyone?)) or shipped with PC DOS\n7.0 and IBM's Visual Age C++ 3.5.\n\nA copy of a Win* viewer is contained in the \"Just add OS/2 Warp\" package\n\nftp://ftp.software.ibm.com/ps/products/os2/tools/jaow/jaow.zip\n\nin ?:\\JUSTADD\\view.exe. This gives one an access to EMX's .INF docs as well (text form is\navailable in /emx/doc in EMX's distribution).  There is also a different viewer named xview.\n\nNote that if you have lynx.exe or netscape.exe installed, you can follow WWW links from this\ndocument in .INF format. If you have EMX docs installed correctly, you can follow library\nlinks (you need to have \"view emxbook\" working by setting \"EMXBOOK\" environment variable as\nit is described in EMX docs).\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "",
                "subsections": [
                    {
                        "name": "Target",
                        "content": "The target is to make OS/2 one of the best supported platform for using/building/developing\nPerl and Perl applications, as well as make Perl the best language to use under OS/2. The\nsecondary target is to try to make this work under DOS and Win* as well (but not too hard).\n\nThe current state is quite close to this target. Known limitations:\n\n•    Some *nix programs use fork() a lot; with the mostly useful flavors of perl for OS/2\n(there are several built simultaneously) this is supported; but some flavors do not\nsupport this (e.g., when Perl is called from inside REXX).  Using fork() after useing\ndynamically loading extensions would not work with very old versions of EMX.\n\n•    You need a separate perl executable perl.exe (see \"perl.exe\") if you want to use PM\ncode in your application (as Perl/Tk or OpenGL Perl modules do) without having a text-\nmode window present.\n\nWhile using the standard perl.exe from a text-mode window is possible too, I have seen\ncases when this causes degradation of the system stability.  Using perl.exe avoids\nsuch a degradation.\n\n•    There is no simple way to access WPS objects. The only way I know is via \"OS2::REXX\" and\n\"SOM\" extensions (see OS2::REXX, SOM).  However, we do not have access to convenience\nmethods of Object-REXX. (Is it possible at all? I know of no Object-REXX API.)  The\n\"SOM\" extension (currently in alpha-text) may eventually remove this shortcoming;\nhowever, due to the fact that DII is not supported by the \"SOM\" module, using \"SOM\" is\nnot as convenient as one would like it.\n\nPlease keep this list up-to-date by informing me about other items.\n"
                    },
                    {
                        "name": "Other OSes",
                        "content": "Since OS/2 port of perl uses a remarkable EMX environment, it can run (and build extensions,\nand - possibly - be built itself) under any environment which can run EMX. The current list\nis DOS, DOS-inside-OS/2, Win0.3*, Win0.95 and WinNT. Out of many perl flavors, only one\nworks, see \"perl.exe\".\n\nNote that not all features of Perl are available under these environments. This depends on\nthe features the extender - most probably RSX - decided to implement.\n\nCf. \"Prerequisites\".\n"
                    },
                    {
                        "name": "Prerequisites",
                        "content": "EMX   EMX runtime is required (may be substituted by RSX). Note that it is possible to make\nperl.exe to run under DOS without any external support by binding emx.exe/rsx.exe to\nit, see \"emxbind\". Note that under DOS for best results one should use RSX runtime,\nwhich has much more functions working (like \"fork\", \"popen\" and so on). In fact RSX is\nrequired if there is no VCPI present. Note the RSX requires DPMI.  Many implementations\nof DPMI are known to be very buggy, beware!\n\nOnly the latest runtime is supported, currently \"0.9d fix 03\". Perl may run under\nearlier versions of EMX, but this is not tested.\n\nOne can get different parts of EMX from, say\n\nftp://crydee.sai.msu.ru/pub/comp/os/os2/leo/gnu/emx+gcc/\nhttp://hobbes.nmsu.edu/h-browse.php?dir=/pub/os2/dev/emx/v0.9d/\n\nThe runtime component should have the name emxrt.zip.\n\nNOTE. When using emx.exe/rsx.exe, it is enough to have them on your path. One does not\nneed to specify them explicitly (though this\n\nemx perl.exe -de 0\n\nwill work as well.)\n\nRSX   To run Perl on DPMI platforms one needs RSX runtime. This is needed under\nDOS-inside-OS/2, Win0.3*, Win0.95 and WinNT (see \"Other OSes\"). RSX would not work with\nVCPI only, as EMX would, it requires DMPI.\n\nHaving RSX and the latest sh.exe one gets a fully functional *nix-ish environment under\nDOS, say, \"fork\", \"``\" and pipe-\"open\" work. In fact, MakeMaker works (for static\nbuild), so one can have Perl development environment under DOS.\n\nOne can get RSX from, say\n\nhttp://cd.textfiles.com/hobbesos29804/disk1/EMX09C/\nftp://crydee.sai.msu.ru/pub/comp/os/os2/leo/gnu/emx+gcc/contrib/\n\nContact the author on \"rainer@mathematik.uni-bielefeld.de\".\n\nThe latest sh.exe with DOS hooks is available in\n\nhttp://www.ilyaz.org/software/os2/\n\nas shdos.zip or under similar names starting with \"sh\", \"pdksh\" etc.\n\nHPFS  Perl does not care about file systems, but the perl library contains many files with\nlong names, so to install it intact one needs a file system which supports long file\nnames.\n\nNote that if you do not plan to build the perl itself, it may be possible to fool EMX\nto truncate file names. This is not supported, read EMX docs to see how to do it.\n\npdksh To start external programs with complicated command lines (like with pipes in between,\nand/or quoting of arguments), Perl uses an external shell. With EMX port such shell\nshould be named sh.exe, and located either in the wired-in-during-compile locations\n(usually F:/bin), or in configurable location (see \"\"PERLSHDIR\"\").\n\nFor best results use EMX pdksh. The standard binary (5.2.14 or later) runs under DOS\n(with \"RSX\") as well, see\n\nhttp://www.ilyaz.org/software/os2/\n"
                    },
                    {
                        "name": "Starting Perl programs under OS/2 (and DOS and...)",
                        "content": "Start your Perl program foo.pl with arguments \"arg1 arg2 arg3\" the same way as on any other\nplatform, by\n\nperl foo.pl arg1 arg2 arg3\n\nIf you want to specify perl options \"-myopts\" to the perl itself (as opposed to your\nprogram), use\n\nperl -myopts foo.pl arg1 arg2 arg3\n\nAlternately, if you use OS/2-ish shell, like CMD or 4os2, put the following at the start of\nyour perl script:\n\nextproc perl -S -myopts\n\nrename your program to foo.cmd, and start it by typing\n\nfoo arg1 arg2 arg3\n\nNote that because of stupid OS/2 limitations the full path of the perl script is not\navailable when you use \"extproc\", thus you are forced to use \"-S\" perl switch, and your\nscript should be on the \"PATH\". As a plus side, if you know a full path to your script, you\nmay still start it with\n\nperl ../../blah/foo.cmd arg1 arg2 arg3\n\n(note that the argument \"-myopts\" is taken care of by the \"extproc\" line in your script, see\n\"\"extproc\" on the first line\").\n\nTo understand what the above magic does, read perl docs about \"-S\" switch - see perlrun, and\ncmdref about \"extproc\":\n\nview perl perlrun\nman perlrun\nview cmdref extproc\nhelp extproc\n\nor whatever method you prefer.\n\nThere are also endless possibilities to use executable extensions of 4os2, associations of\nWPS and so on... However, if you use *nixish shell (like sh.exe supplied in the binary\ndistribution), you need to follow the syntax specified in \"Command Switches\" in perlrun.\n\nNote that -S switch supports scripts with additional extensions .cmd, .btm, .bat, .pl as\nwell.\n"
                    },
                    {
                        "name": "Starting OS/2 (and DOS) programs under Perl",
                        "content": "This is what system() (see \"system\" in perlfunc), \"``\" (see \"I/O Operators\" in perlop), and\nopen pipe (see \"open\" in perlfunc) are for. (Avoid exec() (see \"exec\" in perlfunc) unless you\nknow what you do).\n\nNote however that to use some of these operators you need to have a sh-syntax shell installed\n(see \"Pdksh\", \"Frequently asked questions\"), and perl should be able to find it (see\n\"\"PERLSHDIR\"\").\n\nThe cases when the shell is used are:\n\n1.  One-argument system() (see \"system\" in perlfunc), exec() (see \"exec\" in perlfunc) with\nredirection or shell meta-characters;\n\n2.  Pipe-open (see \"open\" in perlfunc) with the command which contains redirection or shell\nmeta-characters;\n\n3.  Backticks \"``\" (see \"I/O Operators\" in perlop) with the command which contains\nredirection or shell meta-characters;\n\n4.  If the executable called by system()/exec()/pipe-open()/\"``\" is a script with the \"magic\"\n\"#!\" line or \"extproc\" line which specifies shell;\n\n5.  If the executable called by system()/exec()/pipe-open()/\"``\" is a script without \"magic\"\nline, and $ENV{EXECSHELL} is set to shell;\n\n6.  If the executable called by system()/exec()/pipe-open()/\"``\" is not found (is not this\nremark obsolete?);\n\n7.  For globbing (see \"glob\" in perlfunc, \"I/O Operators\" in perlop) (obsolete? Perl uses\nbuiltin globbing nowadays...).\n\nFor the sake of speed for a common case, in the above algorithms backslashes in the command\nname are not considered as shell metacharacters.\n\nPerl starts scripts which begin with cookies \"extproc\" or \"#!\" directly, without an\nintervention of shell.  Perl uses the same algorithm to find the executable as pdksh: if the\npath on \"#!\" line does not work, and contains \"/\", then the directory part of the executable\nis ignored, and the executable is searched in . and on \"PATH\".  To find arguments for these\nscripts Perl uses a different algorithm than pdksh: up to 3 arguments are recognized, and\ntrailing whitespace is stripped.\n\nIf a script does not contain such a cooky, then to avoid calling sh.exe, Perl uses the same\nalgorithm as pdksh: if $ENV{EXECSHELL} is set, the script is given as the first argument to\nthis command, if not set, then \"$ENV{COMSPEC} /c\" is used (or a hardwired guess if\n$ENV{COMSPEC} is not set).\n\nWhen starting scripts directly, Perl uses exactly the same algorithm as for the search of\nscript given by -S command-line option: it will look in the current directory, then on\ncomponents of $ENV{PATH} using the following order of appended extensions: no extension,\n.cmd, .btm, .bat, .pl.\n\nNote that Perl will start to look for scripts only if OS/2 cannot start the specified\napplication, thus \"system 'blah'\" will not look for a script if there is an executable file\nblah.exe anywhere on \"PATH\".  In other words, \"PATH\" is essentially searched twice: once by\nthe OS for an executable, then by Perl for scripts.\n\nNote also that executable files on OS/2 can have an arbitrary extension, but .exe will be\nautomatically appended if no dot is present in the name.  The workaround is as simple as\nthat:  since blah. and blah denote the same file (at list on FAT and HPFS file systems), to\nstart an executable residing in file n:/bin/blah (no extension) give an argument\n\"n:/bin/blah.\" (dot appended) to system().\n\nPerl will start PM programs from VIO (=text-mode) Perl process in a separate PM session; the\nopposite is not true: when you start a non-PM program from a PM Perl process, Perl would not\nrun it in a separate session.  If a separate session is desired, either ensure that shell\nwill be used, as in \"system 'cmd /c myprog'\", or start it using optional arguments to\nsystem() documented in \"OS2::Process\" module.  This is considered to be a feature.\n"
                    },
                    {
                        "name": "Frequently asked questions",
                        "content": ""
                    },
                    {
                        "name": "\"It does not work\"",
                        "content": "Perl binary distributions come with a testperl.cmd script which tries to detect common\nproblems with misconfigured installations.  There is a pretty large chance it will discover\nwhich step of the installation you managed to goof.  \";-)\"\n"
                    },
                    {
                        "name": "I cannot run external programs",
                        "content": "•   Did you run your programs with \"-w\" switch? See \"Starting OS/2 (and DOS) programs under\nPerl\".\n\n•   Do you try to run internal shell commands, like \"`copy a b`\" (internal for cmd.exe), or\n\"`glob a*b`\" (internal for ksh)? You need to specify your shell explicitly, like \"`cmd /c\ncopy a b`\", since Perl cannot deduce which commands are internal to your shell.\n\nI cannot embed perl into my program, or use perl.dll from my program.\nIs your program EMX-compiled with \"-Zmt -Zcrtdll\"?\nWell, nowadays Perl DLL should be usable from a differently compiled program too...  If\nyou can run Perl code from REXX scripts (see OS2::REXX), then there are some other aspect\nof interaction which are overlooked by the current hackish code to support differently-\ncompiled principal programs.\n\nIf everything else fails, you need to build a stand-alone DLL for perl. Contact me, I did\nit once. Sockets would not work, as a lot of other stuff.\n\nDid you use ExtUtils::Embed?\nSome time ago I had reports it does not work.  Nowadays it is checked in the Perl test\nsuite, so grep ./t subdirectory of the build tree (as well as *.t files in the ./lib\nsubdirectory) to find how it should be done \"correctly\".\n"
                    },
                    {
                        "name": "\"``\" and pipe-\"open\" do not work under DOS.",
                        "content": "This may a variant of just \"I cannot run external programs\", or a deeper problem. Basically:\nyou need RSX (see \"Prerequisites\") for these commands to work, and you may need a port of\nsh.exe which understands command arguments. One of such ports is listed in \"Prerequisites\"\nunder RSX. Do not forget to set variable \"\"PERLSHDIR\"\" as well.\n\nDPMI is required for RSX.\n"
                    },
                    {
                        "name": "Cannot start \"find.exe \"pattern\" file\"",
                        "content": "The whole idea of the \"standard C API to start applications\" is that the forms \"foo\" and\n\"foo\" of program arguments are completely interchangeable.  find breaks this paradigm;\n\nfind \"pattern\" file\nfind pattern file\n\nare not equivalent; find cannot be started directly using the above API.  One needs a way to\nsurround the doublequotes in some other quoting construction, necessarily having an extra\nnon-Unixish shell in between.\n\nUse one of\n\nsystem 'cmd', '/c', 'find \"pattern\" file';\n`cmd /c 'find \"pattern\" file'`\n\nThis would start find.exe via cmd.exe via \"sh.exe\" via \"perl.exe\", but this is a price to pay\nif you want to use non-conforming program.\n"
                    }
                ]
            },
            "INSTALLATION": {
                "content": "",
                "subsections": [
                    {
                        "name": "Automatic binary installation",
                        "content": "The most convenient way of installing a binary distribution of perl is via perl installer\ninstall.exe. Just follow the instructions, and 99% of the installation blues would go away.\n\nNote however, that you need to have unzip.exe on your path, and EMX environment running. The\nlatter means that if you just installed EMX, and made all the needed changes to Config.sys,\nyou may need to reboot in between. Check EMX runtime by running\n\nemxrev\n\nBinary installer also creates a folder on your desktop with some useful objects.  If you need\nto change some aspects of the work of the binary installer, feel free to edit the file\nPerl.pkg.  This may be useful e.g., if you need to run the installer many times and do not\nwant to make many interactive changes in the GUI.\n"
                    },
                    {
                        "name": "Things not taken care of by automatic binary installation:",
                        "content": "\"PERLBADLANG\" may be needed if you change your codepage after perl installation, and the new\nvalue is not supported by EMX. See \"\"PERLBADLANG\"\".\n\n\"PERLBADFREE\" see \"\"PERLBADFREE\"\".\n\nConfig.pm      This file resides somewhere deep in the location you installed your perl\nlibrary, find it out by\n\nperl -MConfig -le \"print $INC{'Config.pm'}\"\n\nWhile most important values in this file are updated by the binary installer,\nsome of them may need to be hand-edited. I know no such data, please keep me\ninformed if you find one.  Moreover, manual changes to the installed version\nmay need to be accompanied by an edit of this file.\n\nNOTE. Because of a typo the binary installer of 5.00305 would install a variable\n\"PERLSHPATH\" into Config.sys. Please remove this variable and put \"PERLSHDIR\" instead.\n"
                    },
                    {
                        "name": "Manual binary installation",
                        "content": "As of version 5.00305, OS/2 perl binary distribution comes split into 11 components.\nUnfortunately, to enable configurable binary installation, the file paths in the zip files\nare not absolute, but relative to some directory.\n\nNote that the extraction with the stored paths is still necessary (default with unzip,\nspecify \"-d\" to pkunzip). However, you need to know where to extract the files. You need also\nto manually change entries in Config.sys to reflect where did you put the files. Note that if\nyou have some primitive unzipper (like \"pkunzip\"), you may get a lot of warnings/errors\nduring unzipping. Upgrade to \"(w)unzip\".\n\nBelow is the sample of what to do to reproduce the configuration on my machine.  In VIEW.EXE\nyou can press \"Ctrl-Insert\" now, and cut-and-paste from the resulting file - created in the\ndirectory you started VIEW.EXE from.\n\nFor each component, we mention environment variables related to each installation directory.\nEither choose directories to match your values of the variables, or create/append-to\nvariables to take into account the directories.\n\nPerl VIO and PM executables (dynamically linked)\nunzip perlexc.zip *.exe *.ico -d f:/emx.add/bin\nunzip perlexc.zip *.dll -d f:/emx.add/dll\n\n(have the directories with \"*.exe\" on PATH, and \"*.dll\" on LIBPATH);\n\nPerl VIO executable (statically linked)\nunzip perlaou.zip -d f:/emx.add/bin\n\n(have the directory on PATH);\n\nExecutables for Perl utilities\nunzip perlutl.zip -d f:/emx.add/bin\n\n(have the directory on PATH);\n\nMain Perl library\nunzip perlmlb.zip -d f:/perllib/lib\n\nIf this directory is exactly the same as the prefix which was compiled into perl.exe, you\ndo not need to change anything. However, for perl to find the library if you use a\ndifferent path, you need to \"set PERLLIBPREFIX\" in Config.sys, see \"\"PERLLIBPREFIX\"\".\n\nAdditional Perl modules\nunzip perlste.zip -d f:/perllib/lib/siteperl/5.34.0/\n\nSame remark as above applies.  Additionally, if this directory is not one of directories\non @INC (and @INC is influenced by \"PERLLIBPREFIX\"), you need to put this directory and\nsubdirectory ./os2 in \"PERLLIB\" or \"PERL5LIB\" variable. Do not use \"PERL5LIB\" unless you\nhave it set already. See \"ENVIRONMENT\" in perl.\n\n[Check whether this extraction directory is still applicable with the new directory\nstructure layout!]\n\nTools to compile Perl modules\nunzip perlblb.zip -d f:/perllib/lib\n\nSame remark as for perlste.zip.\n\nManpages for Perl and utilities\nunzip perlman.zip -d f:/perllib/man\n\nThis directory should better be on \"MANPATH\". You need to have a working man to access\nthese files.\n\nManpages for Perl modules\nunzip perlmam.zip -d f:/perllib/man\n\nThis directory should better be on \"MANPATH\". You need to have a working man to access\nthese files.\n\nSource for Perl documentation\nunzip perlpod.zip -d f:/perllib/lib\n\nThis is used by the \"perldoc\" program (see perldoc), and may be used to generate HTML\ndocumentation usable by WWW browsers, and documentation in zillions of other formats:\n\"info\", \"LaTeX\", \"Acrobat\", \"FrameMaker\" and so on.  [Use programs such as pod2latex etc.]\n\nPerl manual in .INF format\nunzip perlinf.zip -d d:/os2/book\n\nThis directory should better be on \"BOOKSHELF\".\n\nPdksh\nunzip perlsh.zip -d f:/bin\n\nThis is used by perl to run external commands which explicitly require shell, like the\ncommands using redirection and shell metacharacters. It is also used instead of explicit\n/bin/sh.\n\nSet \"PERLSHDIR\" (see \"\"PERLSHDIR\"\") if you move sh.exe from the above location.\n\nNote. It may be possible to use some other sh-compatible shell (untested).\n\nAfter you installed the components you needed and updated the Config.sys correspondingly, you\nneed to hand-edit Config.pm. This file resides somewhere deep in the location you installed\nyour perl library, find it out by\n\nperl -MConfig -le \"print $INC{'Config.pm'}\"\n\nYou need to correct all the entries which look like file paths (they currently start with\n\"f:/\").\n"
                    },
                    {
                        "name": "Warning",
                        "content": "The automatic and manual perl installation leave precompiled paths inside perl executables.\nWhile these paths are overwritable (see \"\"PERLLIBPREFIX\"\", \"\"PERLSHDIR\"\"), some people may\nprefer binary editing of paths inside the executables/DLLs.\n"
                    },
                    {
                        "name": "Accessing documentation",
                        "content": "Depending on how you built/installed perl you may have (otherwise identical) Perl\ndocumentation in the following formats:\n\nOS/2 .INF file\nMost probably the most convenient form. Under OS/2 view it as\n\nview perl\nview perl perlfunc\nview perl less\nview perl ExtUtils::MakeMaker\n\n(currently the last two may hit a wrong location, but this may improve soon). Under Win* see\n\"SYNOPSIS\".\n\nIf you want to build the docs yourself, and have OS/2 toolkit, run\n\npod2ipf > perl.ipf\n\nin /perllib/lib/pod directory, then\n\nipfc /inf perl.ipf\n\n(Expect a lot of errors during the both steps.) Now move it on your BOOKSHELF path.\n"
                    },
                    {
                        "name": "Plain text",
                        "content": "If you have perl documentation in the source form, perl utilities installed, and GNU groff\ninstalled, you may use\n\nperldoc perlfunc\nperldoc less\nperldoc ExtUtils::MakeMaker\n\nto access the perl documentation in the text form (note that you may get better results using\nperl manpages).\n\nAlternately, try running pod2text on .pod files.\n"
                    },
                    {
                        "name": "Manpages",
                        "content": "If you have man installed on your system, and you installed perl manpages, use something like\nthis:\n\nman perlfunc\nman 3 less\nman ExtUtils.MakeMaker\n\nto access documentation for different components of Perl. Start with\n\nman perl\n\nNote that dot (.) is used as a package separator for documentation for packages, and as\nusual, sometimes you need to give the section - 3 above - to avoid shadowing by the lleessss(1)\nmanpage.\n\nMake sure that the directory above the directory with manpages is on our \"MANPATH\", like this\n\nset MANPATH=c:/man;f:/perllib/man\n\nfor Perl manpages in \"f:/perllib/man/man1/\" etc.\n\nHTML\nIf you have some WWW browser available, installed the Perl documentation in the source form,\nand Perl utilities, you can build HTML docs. Cd to directory with .pod files, and do like\nthis\n\ncd f:/perllib/lib/pod\npod2html\n\nAfter this you can direct your browser the file perl.html in this directory, and go ahead\nwith reading docs, like this:\n\nexplore file:///f:/perllib/lib/pod/perl.html\n\nAlternatively you may be able to get these docs prebuilt from CPAN.\n"
                    },
                    {
                        "name": "GNU \"info\" files",
                        "content": "Users of Emacs would appreciate it very much, especially with \"CPerl\" mode loaded. You need\nto get latest \"pod2texi\" from \"CPAN\", or, alternately, the prebuilt info pages.\n\nPDF files\nfor \"Acrobat\" are available on CPAN (may be for slightly older version of perl).\n"
                    },
                    {
                        "name": "\"LaTeX\" docs",
                        "content": "can be constructed using \"pod2latex\".\n"
                    }
                ]
            },
            "BUILD": {
                "content": "Here we discuss how to build Perl under OS/2.\n",
                "subsections": [
                    {
                        "name": "The short story",
                        "content": "Assume that you are a seasoned porter, so are sure that all the necessary tools are already\npresent on your system, and you know how to get the Perl source distribution.  Untar it,\nchange to the extract directory, and\n\ngnupatch -p0 < os2\\diff.configure\nsh Configure -des -D prefix=f:/perllib\nmake\nmake test\nmake install\nmake aouttest\nmake aoutinstall\n\nThis puts the executables in f:/perllib/bin.  Manually move them to the \"PATH\", manually move\nthe built perl*.dll to \"LIBPATH\" (here for Perl DLL * is a not-very-meaningful hex checksum),\nand run\n\nmake installcmd INSTALLCMDDIR=d:/ir/on/path\n\nAssuming that the \"man\"-files were put on an appropriate location, this completes the\ninstallation of minimal Perl system.  (The binary distribution contains also a lot of\nadditional modules, and the documentation in INF format.)\n\nWhat follows is a detailed guide through these steps.\n"
                    },
                    {
                        "name": "Prerequisites",
                        "content": "You need to have the latest EMX development environment, the full GNU tool suite (gawk\nrenamed to awk, and GNU find.exe earlier on path than the OS/2 find.exe, same with sort.exe,\nto check use\n\nfind --version\nsort --version\n\n). You need the latest version of pdksh installed as sh.exe.\n\nCheck that you have BSD libraries and headers installed, and - optionally - Berkeley DB\nheaders and libraries, and crypt.\n\nPossible locations to get the files:\n\nftp://ftp.uni-heidelberg.de/pub/os2/unix/\nhttp://hobbes.nmsu.edu/h-browse.php?dir=/pub/os2\nhttp://cd.textfiles.com/hobbesos29804/disk1/DEV32/\nhttp://cd.textfiles.com/hobbesos29804/disk1/EMX09C/\n\nIt is reported that the following archives contain enough utils to build perl: gnufutil.zip,\ngnusutil.zip, gnututil.zip, gnused.zip, gnupatch.zip, gnuawk.zip, gnumake.zip, gnugrep.zip,\nbsddev.zip and ksh527rt.zip (or a later version).  Note that all these utilities are known to\nbe available from LEO:\n\nftp://crydee.sai.msu.ru/pub/comp/os/os2/leo/gnu/\n\nNote also that the db.lib and db.a from the EMX distribution are not suitable for multi-\nthreaded compile (even single-threaded flavor of Perl uses multi-threaded C RTL, for\ncompatibility with XFree86-OS/2). Get a corrected one from\n\nhttp://www.ilyaz.org/software/os2/dbmt.zip\n\nIf you have exactly the same version of Perl installed already, make sure that no copies or\nperl are currently running.  Later steps of the build may fail since an older version of\nperl.dll loaded into memory may be found.  Running \"make test\" becomes meaningless, since the\ntest are checking a previous build of perl (this situation is detected and reported by\nos2/os2base.t test).  Do not forget to unset \"PERLEMXLOADSEC\" in environment.\n\nAlso make sure that you have /tmp directory on the current drive, and . directory in your\n\"LIBPATH\". One may try to correct the latter condition by\n\nset BEGINLIBPATH .\\.\n\nif you use something like CMD.EXE or latest versions of 4os2.exe.  (Setting BEGINLIBPATH to\njust \".\" is ignored by the OS/2 kernel.)\n\nMake sure your gcc is good for \"-Zomf\" linking: run \"omflibs\" script in /emx/lib directory.\n\nCheck that you have link386 installed. It comes standard with OS/2, but may be not installed\ndue to customization. If typing\n\nlink386\n\nshows you do not have it, do Selective install, and choose \"Link object modules\" in Optional\nsystem utilities/More. If you get into link386 prompts, press \"Ctrl-C\" to exit.\n"
                    },
                    {
                        "name": "Getting perl source",
                        "content": "You need to fetch the latest perl source (including developers releases). With some\nprobability it is located in\n\nhttp://www.cpan.org/src/\nhttp://www.cpan.org/src/unsupported\n\nIf not, you may need to dig in the indices to find it in the directory of the current\nmaintainer.\n\nQuick cycle of developers release may break the OS/2 build time to time, looking into\n\nhttp://www.cpan.org/ports/os2/\n\nmay indicate the latest release which was publicly released by the maintainer. Note that the\nrelease may include some additional patches to apply to the current source of perl.\n\nExtract it like this\n\ntar vzxf perl5.00409.tar.gz\n\nYou may see a message about errors while extracting Configure. This is because there is a\nconflict with a similarly-named file configure.\n\nChange to the directory of extraction.\n"
                    },
                    {
                        "name": "Application of the patches",
                        "content": "You need to apply the patches in ./os2/diff.* like this:\n\ngnupatch -p0 < os2\\diff.configure\n\nYou may also need to apply the patches supplied with the binary distribution of perl.  It\nalso makes sense to look on the perl5-porters mailing list for the latest OS/2-related\npatches (see <http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/>).  Such patches\nusually contain strings \"/os2/\" and \"patch\", so it makes sense looking for these strings.\n"
                    },
                    {
                        "name": "Hand-editing",
                        "content": "You may look into the file ./hints/os2.sh and correct anything wrong you find there. I do not\nexpect it is needed anywhere.\n"
                    },
                    {
                        "name": "Making",
                        "content": "sh Configure -des -D prefix=f:/perllib\n\n\"prefix\" means: where to install the resulting perl library. Giving correct prefix you may\navoid the need to specify \"PERLLIBPREFIX\", see \"\"PERLLIBPREFIX\"\".\n\nIgnore the message about missing \"ln\", and about \"-c\" option to tr. The latter is most\nprobably already fixed, if you see it and can trace where the latter spurious warning comes\nfrom, please inform me.\n\nNow\n\nmake\n\nAt some moment the built may die, reporting a version mismatch or unable to run perl.  This\nmeans that you do not have . in your LIBPATH, so perl.exe cannot find the needed perl67B2.dll\n(treat these hex digits as line noise).  After this is fixed the build should finish without\na lot of fuss.\n"
                    },
                    {
                        "name": "Testing",
                        "content": "Now run\n\nmake test\n\nAll tests should succeed (with some of them skipped).  If you have the same version of Perl\ninstalled, it is crucial that you have \".\" early in your LIBPATH (or in BEGINLIBPATH),\notherwise your tests will most probably test the wrong version of Perl.\n\nSome tests may generate extra messages similar to\n\nA lot of \"bad free\"\nin database tests related to Berkeley DB. This should be fixed already.  If it persists,\nyou may disable this warnings, see \"\"PERLBADFREE\"\".\n\nProcess terminated by SIGTERM/SIGINT\nThis is a standard message issued by OS/2 applications. *nix applications die in silence.\nIt is considered to be a feature. One can easily disable this by appropriate sighandlers.\n\nHowever the test engine bleeds these message to screen in unexpected moments. Two\nmessages of this kind should be present during testing.\n\nTo get finer test reports, call\n\nperl t/harness\n\nThe report with io/pipe.t failing may look like this:\n\nFailed Test  Status Wstat Total Fail  Failed  List of failed\n------------------------------------------------------------\nio/pipe.t                    12    1   8.33%  9\n7 tests skipped, plus 56 subtests skipped.\nFailed 1/195 test scripts, 99.49% okay. 1/6542 subtests failed,\n99.98% okay.\n\nThe reasons for most important skipped tests are:\n\nop/fs.t\n18  Checks \"atime\" and \"mtime\" of \"stat()\" - unfortunately, HPFS provides only 2sec\ntime granularity (for compatibility with FAT?).\n\n25  Checks \"truncate()\" on a filehandle just opened for write - I do not know why\nthis should or should not work.\n\nop/stat.t\nChecks \"stat()\". Tests:\n\n4   Checks \"atime\" and \"mtime\" of \"stat()\" - unfortunately, HPFS provides only 2sec\ntime granularity (for compatibility with FAT?).\n"
                    },
                    {
                        "name": "Installing the built perl",
                        "content": "If you haven't yet moved \"perl*.dll\" onto LIBPATH, do it now.\n\nRun\n\nmake install\n\nIt would put the generated files into needed locations. Manually put perl.exe, perl.exe and\nperl.exe to a location on your PATH, perl.dll to a location on your LIBPATH.\n\nRun\n\nmake installcmd INSTALLCMDDIR=d:/ir/on/path\n\nto convert perl utilities to .cmd files and put them on PATH. You need to put .EXE-utilities\non path manually. They are installed in \"$prefix/bin\", here $prefix is what you gave to\nConfigure, see \"Making\".\n\nIf you use \"man\", either move the installed */man/ directories to your \"MANPATH\", or modify\n\"MANPATH\" to match the location.  (One could have avoided this by providing a correct\n\"manpath\" option to ./Configure, or editing ./config.sh between configuring and making\nsteps.)\n"
                    },
                    {
                        "name": "\"a.out\"-style build",
                        "content": "Proceed as above, but make perl.exe (see \"perl.exe\") by\n\nmake perl\n\ntest and install by\n\nmake aouttest\nmake aoutinstall\n\nManually put perl.exe to a location on your PATH.\n\nNote. The build process for \"perl\" does not know about all the dependencies, so you should\nmake sure that anything is up-to-date, say, by doing\n\nmake perldll\n\nfirst.\n"
                    },
                    {
                        "name": "Building a binary distribution",
                        "content": "[This section provides a short overview only...]\n\nBuilding should proceed differently depending on whether the version of perl you install is\nalready present and used on your system, or is a new version not yet used.  The description\nbelow assumes that the version is new, so installing its DLLs and .pm files will not disrupt\nthe operation of your system even if some intermediate steps are not yet fully working.\n\nThe other cases require a little bit more convoluted procedures.  Below I suppose that the\ncurrent version of Perl is 5.8.2, so the executables are named accordingly.\n\n1.  Fully build and test the Perl distribution.  Make sure that no tests are failing with\n\"test\" and \"aouttest\" targets; fix the bugs in Perl and the Perl test suite detected by\nthese tests.  Make sure that \"alltest\" make target runs as clean as possible.  Check\nthat os2/perlrexx.cmd runs fine.\n\n2.  Fully install Perl, including \"installcmd\" target.  Copy the generated DLLs to \"LIBPATH\";\ncopy the numbered Perl executables (as in perl5.8.2.exe) to \"PATH\"; copy \"perl.exe\" to\n\"PATH\" as \"perl5.8.2.exe\".  Think whether you need backward-compatibility DLLs.  In most\ncases you do not need to install them yet; but sometime this may simplify the following\nsteps.\n\n3.  Make sure that \"CPAN.pm\" can download files from CPAN.  If not, you may need to manually\ninstall \"Net::FTP\".\n\n4.  Install the bundle \"Bundle::OS2default\"\n\nperl5.8.2 -MCPAN -e \"install Bundle::OS2default\" < nul |& tee 00cpani1\n\nThis may take a couple of hours on 1GHz processor (when run the first time).  And this\nshould not be necessarily a smooth procedure.  Some modules may not specify required\ndependencies, so one may need to repeat this procedure several times until the results\nstabilize.\n\nperl5.8.2 -MCPAN -e \"install Bundle::OS2default\" < nul |& tee 00cpani2\nperl5.8.2 -MCPAN -e \"install Bundle::OS2default\" < nul |& tee 00cpani3\n\nEven after they stabilize, some tests may fail.\n\nFix as many discovered bugs as possible.  Document all the bugs which are not fixed, and\nall the failures with unknown reasons.  Inspect the produced logs 00cpani1 to find\nsuspiciously skipped tests, and other fishy events.\n\nKeep in mind that installation of some modules may fail too: for example, the DLLs to\nupdate may be already loaded by CPAN.pm.  Inspect the \"install\" logs (in the example\nabove 00cpani1 etc) for errors, and install things manually, as in\n\ncd $CPANHOME/.cpan/build/Digest-MD5-2.31\nmake install\n\nSome distributions may fail some tests, but you may want to install them anyway (as\nabove, or via \"force install\" command of \"CPAN.pm\" shell-mode).\n\nSince this procedure may take quite a long time to complete, it makes sense to \"freeze\"\nyour CPAN configuration by disabling periodic updates of the local copy of CPAN index:\nset \"indexexpire\" to some big value (I use 365), then save the settings\n\nCPAN> o conf indexexpire 365\nCPAN> o conf commit\n\nReset back to the default value 1 when you are finished.\n\n5.  When satisfied with the results, rerun the \"installcmd\" target.  Now you can copy\n\"perl5.8.2.exe\" to \"perl.exe\", and install the other OMF-build executables: \"perl.exe\"\netc.  They are ready to be used.\n\n6.  Change to the \"./pod\" directory of the build tree, download the Perl logo\nCamelGrayBig.BMP, and run\n\n( perl2ipf > perl.ipf ) |& tee 00ipf\nipfc /INF perl.ipf |& tee 00inf\n\nThis produces the Perl docs online book \"perl.INF\".  Install in on \"BOOKSHELF\" path.\n\n7.  Now is the time to build statically linked executable perl.exe which includes newly-\ninstalled via \"Bundle::OS2default\" modules.  Doing testing via \"CPAN.pm\" is going to be\npainfully slow, since it statically links a new executable per XS extension.\n\nHere is a possible workaround: create a toplevel Makefile.PL in $CPANHOME/.cpan/build/\nwith contents being (compare with \"Making executables with a custom collection of\nstatically loaded extensions\")\n\nuse ExtUtils::MakeMaker;\nWriteMakefile NAME => 'dummy';\n\nexecute this as\n\nperl5.8.2.exe Makefile.PL <nul |& tee 00aoutc1\nmake -k all test <nul |& 00aoutt1\n\nAgain, this procedure should not be absolutely smooth.  Some \"Makefile.PL\"'s in\nsubdirectories may be buggy, and would not run as \"child\" scripts.  The interdependency\nof modules can strike you; however, since non-XS modules are already installed, the\nprerequisites of most modules have a very good chance to be present.\n\nIf you discover some glitches, move directories of problematic modules to a different\nlocation; if these modules are non-XS modules, you may just ignore them - they are\nalready installed; the remaining, XS, modules you need to install manually one by one.\n\nAfter each such removal you need to rerun the \"Makefile.PL\"/\"make\" process; usually this\nprocedure converges soon.  (But be sure to convert all the necessary external C libraries\nfrom .lib format to .a format: run one of\n\nemxaout foo.lib\nemximp -o foo.a foo.lib\n\nwhichever is appropriate.)  Also, make sure that the DLLs for external libraries are\nusable with executables compiled without \"-Zmtd\" options.\n\nWhen you are sure that only a few subdirectories lead to failures, you may want to add\n\"-j4\" option to \"make\" to speed up skipping subdirectories with already finished build.\n\nWhen you are satisfied with the results of tests, install the build C libraries for\nextensions:\n\nmake install |& tee 00aouti\n\nNow you can rename the file ./perl.exe generated during the last phase to perl5.8.2.exe;\nplace it on \"PATH\"; if there is an inter-dependency between some XS modules, you may need\nto repeat the \"test\"/\"install\" loop with this new executable and some excluded modules -\nuntil the procedure converges.\n\nNow you have all the necessary .a libraries for these Perl modules in the places where\nPerl builder can find it.  Use the perl builder: change to an empty directory, create a\n\"dummy\" Makefile.PL again, and run\n\nperl5.8.2.exe Makefile.PL |& tee 00c\nmake perl                  |& tee 00p\n\nThis should create an executable ./perl.exe with all the statically loaded extensions\nbuilt in.  Compare the generated perlmain.c files to make sure that during the iterations\nthe number of loaded extensions only increases.  Rename ./perl.exe to perl5.8.2.exe on\n\"PATH\".\n\nWhen it converges, you got a functional variant of perl5.8.2.exe; copy it to\n\"perl.exe\".  You are done with generation of the local Perl installation.\n\n8.  Make sure that the installed modules are actually installed in the location of the new\nPerl, and are not inherited from entries of @INC given for inheritance from the older\nversions of Perl: set \"PERLLIB582PREFIX\" to redirect the new version of Perl to a new\nlocation, and copy the installed files to this new location.  Redo the tests to make sure\nthat the versions of modules inherited from older versions of Perl are not needed.\n\nActually, the log output of pod2ipf(1) during the step 6 gives a very detailed info about\nwhich modules are loaded from which place; so you may use it as an additional\nverification tool.\n\nCheck that some temporary files did not make into the perl install tree.  Run something\nlike this\n\npfind . -f \"!(/\\.(pm|pl|ix|al|h|a|lib|txt|pod|imp|bs|dll|ld|bs|inc|xbm|yml|cgi|uu|e2x|skip|packlist|eg|cfg|html|pub|enc|all|ini|po|pot)$/i or /^\\w+$/\") | less\n\nin the install tree (both top one and sitelib one).\n\nCompress all the DLLs with lxlite.  The tiny .exe can be compressed with \"/c:max\" (the\nbug only appears when there is a fixup in the last 6 bytes of a page (?); since the tiny\nexecutables are much smaller than a page, the bug will not hit).  Do not compress\n\"perl.exe\" - it would not work under DOS.\n\n9.  Now you can generate the binary distribution.  This is done by running the test of the\nCPAN distribution \"OS2::SoftInstaller\".  Tune up the file test.pl to suit the layout of\ncurrent version of Perl first.  Do not forget to pack the necessary external DLLs\naccordingly.  Include the description of the bugs and test suite failures you could not\nfix.  Include the small-stack versions of Perl executables from Perl build directory.\n\nInclude perl5.def so that people can relink the perl DLL preserving the binary\ncompatibility, or can create compatibility DLLs.  Include the diff files (\"diff -pu old\nnew\") of fixes you did so that people can rebuild your version.  Include perl5.map so\nthat one can use remote debugging.\n\n10. Share what you did with the other people.  Relax.  Enjoy fruits of your work.\n\n11. Brace yourself for thanks, bug reports, hate mail and spam coming as result of the\nprevious step.  No good deed should remain unpunished!\n"
                    }
                ]
            },
            "Building custom .EXE files": {
                "content": "The Perl executables can be easily rebuilt at any moment.  Moreover, one can use the\nembedding interface (see perlembed) to make very customized executables.\n",
                "subsections": [
                    {
                        "name": "Making executables with a custom collection of statically loaded extensions",
                        "content": "It is a little bit easier to do so while decreasing the list of statically loaded extensions.\nWe discuss this case only here.\n\n1.  Change to an empty directory, and create a placeholder <Makefile.PL>:\n\nuse ExtUtils::MakeMaker;\nWriteMakefile NAME => 'dummy';\n\n2.  Run it with the flavor of Perl (perl.exe or perl.exe) you want to rebuild.\n\nperl Makefile.PL\n\n3.  Ask it to create new Perl executable:\n\nmake perl\n\n(you may need to manually add \"PERLTYPE=-DPERLCORE\" to this commandline on some versions\nof Perl; the symptom is that the command-line globbing does not work from OS/2 shells\nwith the newly-compiled executable; check with\n\n.\\perl.exe -wle \"print for @ARGV\" *\n\n).\n\n4.  The previous step created perlmain.c which contains a list of newXS() calls near the end.\nRemoving unnecessary calls, and rerunning\n\nmake perl\n\nwill produce a customized executable.\n"
                    },
                    {
                        "name": "Making executables with a custom search-paths",
                        "content": "The default perl executable is flexible enough to support most usages.  However, one may want\nsomething yet more flexible; for example, one may want to find Perl DLL relatively to the\nlocation of the EXE file; or one may want to ignore the environment when setting the Perl-\nlibrary search patch, etc.\n\nIf you fill comfortable with embedding interface (see perlembed), such things are easy to do\nrepeating the steps outlined in \"Making executables with a custom collection of statically\nloaded extensions\", and doing more comprehensive edits to main() of perlmain.c.  The people\nwith little desire to understand Perl can just rename main(), and do necessary modification\nin a custom main() which calls the renamed function in appropriate time.\n\nHowever, there is a third way: perl DLL exports the main() function and several callbacks to\ncustomize the search path.  Below is a complete example of a \"Perl loader\" which\n\n1.  Looks for Perl DLL in the directory \"$exedir/../dll\";\n\n2.  Prepends the above directory to \"BEGINLIBPATH\";\n\n3.  Fails if the Perl DLL found via \"BEGINLIBPATH\" is different from what was loaded on step\n1; e.g., another process could have loaded it from \"LIBPATH\" or from a different value of\n\"BEGINLIBPATH\".  In these cases one needs to modify the setting of the system so that\nthis other process either does not run, or loads the DLL from \"BEGINLIBPATH\" with\n\"LIBPATHSTRICT=T\" (available with kernels after September 2000).\n\n4.  Loads Perl library from \"$exedir/../dll/lib/\".\n\n5.  Uses Bourne shell from \"$exedir/../dll/sh/ksh.exe\".\n\nFor best results compile the C file below with the same options as the Perl DLL.  However, a\nlot of functionality will work even if the executable is not an EMX applications, e.g., if\ncompiled with\n\ngcc -Wall -DDOSISH -DOS2=1 -O2 -s -Zomf -Zsys perl-starter.c \\\n-DPERLDLLBASENAME=\\\"perl312F\\\" -Zstack 8192 -Zlinker /PM:VIO\n\nHere is the sample C file:\n\n#define INCLDOS\n#define INCLNOPM\n/* These are needed for compile if os2.h includes os2tk.h, not\n* os2emx.h */\n#define INCLDOSPROCESS\n#include <os2.h>\n\n#include \"EXTERN.h\"\n#define PERLINMINIPERLMAINC\n#include \"perl.h\"\n\nstatic char *me;\nHMODULE handle;\n\nstatic void\ndiewith(char *msg1, char *msg2, char *msg3, char *msg4)\n{\nULONG c;\nchar *s = \" error: \";\n\nDosWrite(2, me, strlen(me), &c);\nDosWrite(2, s, strlen(s), &c);\nDosWrite(2, msg1, strlen(msg1), &c);\nDosWrite(2, msg2, strlen(msg2), &c);\nDosWrite(2, msg3, strlen(msg3), &c);\nDosWrite(2, msg4, strlen(msg4), &c);\nDosWrite(2, \"\\r\\n\", 2, &c);\nexit(255);\n}\n\ntypedef ULONG (*fillextLibpatht)(int type,\nchar *pre,\nchar *post,\nint replace,\nchar *msg);\ntypedef int (*maint)(int type, char *argv[], char *env[]);\ntypedef int (*handlert)(void* data, int which);\n\n#ifndef PERLDLLBASENAME\n#  define PERLDLLBASENAME \"perl\"\n#endif\n\nstatic HMODULE\nloadperldll(char *basename)\n{\nchar buf[300], fail[260];\nSTRLEN l, dirl;\nfillextLibpatht f;\nULONG rcfullname;\nHMODULE handle, handle1;\n\nif (execname(buf, sizeof(buf) - 13) != 0)\ndiewith(\"Can't find full path: \", strerror(errno), \"\", \"\");\n/* XXXX Fill 'me' with new value */\nl = strlen(buf);\nwhile (l && buf[l-1] != '/' && buf[l-1] != '\\\\')\nl--;\ndirl = l - 1;\nstrcpy(buf + l, basename);\nl += strlen(basename);\nstrcpy(buf + l, \".dll\");\nif ( (rcfullname = DosLoadModule(fail, sizeof fail, buf, &handle))\n!= 0\n&& DosLoadModule(fail, sizeof fail, basename, &handle) != 0 )\ndiewith(\"Can't load DLL \", buf, \"\", \"\");\nif (rcfullname)\nreturn handle;    /* was loaded with short name; all is fine */\nif (DosQueryProcAddr(handle, 0, \"fillextLibpath\", (PFN*)&f))\ndiewith(buf,\n\": DLL exports no symbol \",\n\"fillextLibpath\",\n\"\");\nbuf[dirl] = 0;\nif (f(0 /*BEGINLIBPATH*/, buf /* prepend */, NULL /* append */,\n0 /* keep old value */, me))\ndiewith(me, \": prepending BEGINLIBPATH\", \"\", \"\");\nif (DosLoadModule(fail, sizeof fail, basename, &handle1) != 0)\ndiewith(me,\n\": finding perl DLL again via BEGINLIBPATH\",\n\"\",\n\"\");\nbuf[dirl] = '\\\\';\nif (handle1 != handle) {\nif (DosQueryModuleName(handle1, sizeof(fail), fail))\nstrcpy(fail, \"???\");\ndiewith(buf,\n\":\\n\\tperl DLL via BEGINLIBPATH is different: \\n\\t\",\nfail,\n\"\\n\\tYou may need to manipulate global BEGINLIBPATH\"\n\" and LIBPATHSTRICT\"\n\"\\n\\tso that the other copy is loaded via\"\nBEGINLIBPATH.\");\n}\nreturn handle;\n}\n\nint\nmain(int argc, char argv, char env)\n{\nmaint f;\nhandlert h;\n\nme = argv[0];\n//\nhandle = loadperldll(PERLDLLBASENAME);\n\nif (DosQueryProcAddr(handle,\n0,\n\"PerlOS2handlerinstall\",\n(PFN*)&h))\ndiewith(PERLDLLBASENAME,\n\": DLL exports no symbol \",\n\"PerlOS2handlerinstall\",\n\"\");\nif ( !h((void *)\"~installprefix\", Perlos2handlerperllibfrom)\n|| !h((void *)\"~dll\", Perlos2handlerperllibto)\n|| !h((void *)\"~dll/sh/ksh.exe\", Perlos2handlerperlsh) )\ndiewith(PERLDLLBASENAME,\n\": Can't install @INC manglers\",\n\"\",\n\"\");\nif (DosQueryProcAddr(handle, 0, \"dllperlmain\", (PFN*)&f))\ndiewith(PERLDLLBASENAME,\n\": DLL exports no symbol \",\n\"dllperlmain\",\n\"\");\nreturn f(argc, argv, env);\n}\n"
                    },
                    {
                        "name": "Build FAQ",
                        "content": ""
                    },
                    {
                        "name": "Some \"/\" became \"\\\" in pdksh.",
                        "content": "You have a very old pdksh. See \"Prerequisites\".\n"
                    },
                    {
                        "name": "'errno' - unresolved external",
                        "content": "You do not have MT-safe db.lib. See \"Prerequisites\".\n"
                    },
                    {
                        "name": "Problems with tr or sed",
                        "content": "reported with very old version of tr and sed.\n"
                    },
                    {
                        "name": "Some problem (forget which ;-)",
                        "content": "You have an older version of perl.dll on your LIBPATH, which broke the build of extensions.\n"
                    },
                    {
                        "name": "Library ... not found",
                        "content": "You did not run \"omflibs\". See \"Prerequisites\".\n"
                    },
                    {
                        "name": "Segfault in make",
                        "content": "You use an old version of GNU make. See \"Prerequisites\".\n"
                    },
                    {
                        "name": "op/sprintf test failure",
                        "content": "This can result from a bug in emx sprintf which was fixed in 0.9d fix 03.\n"
                    },
                    {
                        "name": "Specific (mis)features of OS/2 port",
                        "content": ""
                    },
                    {
                        "name": "\"setpriority\", \"getpriority\"",
                        "content": "Note that these functions are compatible with *nix, not with the older ports of '94 - 95. The\npriorities are absolute, go from 32 to -95, lower is quicker. 0 is the default priority.\n\nWARNING.  Calling \"getpriority\" on a non-existing process could lock the system before Warp3\nfixpak22.  Starting with Warp3, Perl will use a workaround: it aborts getpriority() if the\nprocess is not present.  This is not possible on older versions \"2.*\", and has a race\ncondition anyway.\n"
                    },
                    {
                        "name": "\"system()\"",
                        "content": "Multi-argument form of \"system()\" allows an additional numeric argument. The meaning of this\nargument is described in OS2::Process.\n\nWhen finding a program to run, Perl first asks the OS to look for executables on \"PATH\" (OS/2\nadds extension .exe if no extension is present).  If not found, it looks for a script with\npossible extensions added in this order: no extension, .cmd, .btm, .bat, .pl.  If found, Perl\nchecks the start of the file for magic strings \"#!\" and \"extproc \".  If found, Perl uses the\nrest of the first line as the beginning of the command line to run this script.  The only\nmangling done to the first line is extraction of arguments (currently up to 3), and ignoring\nof the path-part of the \"interpreter\" name if it can't be found using the full path.\n\nE.g., \"system 'foo', 'bar', 'baz'\" may lead Perl to finding C:/emx/bin/foo.cmd with the first\nline being\n\nextproc /bin/bash    -x   -c\n\nIf /bin/bash.exe is not found, then Perl looks for an executable bash.exe on \"PATH\".  If\nfound in C:/emx.add/bin/bash.exe, then the above system() is translated to\n\nsystem qw(C:/emx.add/bin/bash.exe -x -c C:/emx/bin/foo.cmd bar baz)\n\nOne additional translation is performed: instead of /bin/sh Perl uses the hardwired-or-\ncustomized shell (see \"\"PERLSHDIR\"\").\n\nThe above search for \"interpreter\" is recursive: if bash executable is not found, but\nbash.btm is found, Perl will investigate its first line etc.  The only hardwired limit on the\nrecursion depth is implicit: there is a limit 4 on the number of additional arguments\ninserted before the actual arguments given to system().  In particular, if no additional\narguments are specified on the \"magic\" first lines, then the limit on the depth is 4.\n\nIf Perl finds that the found executable is of PM type when the current session is not, it\nwill start the new process in a separate session of necessary type.  Call via \"OS2::Process\"\nto disable this magic.\n\nWARNING.  Due to the described logic, you need to explicitly specify .com extension if\nneeded.  Moreover, if the executable perl5.6.1 is requested, Perl will not look for\nperl5.6.1.exe.  [This may change in the future.]\n"
                    },
                    {
                        "name": "\"extproc\" on the first line",
                        "content": "If the first chars of a Perl script are \"extproc \", this line is treated as \"#!\"-line, thus\nall the switches on this line are processed (twice if script was started via cmd.exe).  See\n\"DESCRIPTION\" in perlrun.\n"
                    },
                    {
                        "name": "Additional modules:",
                        "content": "OS2::Process, OS2::DLL, OS2::REXX, OS2::PrfDB, OS2::ExtAttr. These modules provide access to\nadditional numeric argument for \"system\" and to the information about the running process, to\nDLLs having functions with REXX signature and to the REXX runtime, to OS/2 databases in the\n.INI format, and to Extended Attributes.\n\nTwo additional extensions by Andreas Kaiser, \"OS2::UPM\", and \"OS2::FTP\", are included into\n\"ILYAZ\" directory, mirrored on CPAN.  Other OS/2-related extensions are available too.\n"
                    },
                    {
                        "name": "Prebuilt methods:",
                        "content": "\"File::Copy::syscopy\"\nused by \"File::Copy::copy\", see File::Copy.\n\n\"DynaLoader::mod2fname\"\nused by \"DynaLoader\" for DLL name mangling.\n\n\"Cwd::currentdrive()\"\nSelf explanatory.\n\n\"Cwd::syschdir(name)\"\nleaves drive as it is.\n\n\"Cwd::changedrive(name)\"\nchanges the \"current\" drive.\n\n\"Cwd::sysisabsolute(name)\"\nmeans has drive letter and isrooted.\n\n\"Cwd::sysisrooted(name)\"\nmeans has leading \"[/\\\\]\" (maybe after a drive-letter:).\n\n\"Cwd::sysisrelative(name)\"\nmeans changes with current dir.\n\n\"Cwd::syscwd(name)\"\nInterface to cwd from EMX. Used by \"Cwd::cwd\".\n\n\"Cwd::sysabspath(name, dir)\"\nReally really odious function to implement. Returns absolute name of file which would\nhave \"name\" if CWD were \"dir\".  \"Dir\" defaults to the current dir.\n\n\"Cwd::extLibpath([type])\"\nGet current value of extended library search path. If \"type\" is present and positive,\nworks with \"ENDLIBPATH\", if negative, works with \"LIBPATHSTRICT\", otherwise with\n\"BEGINLIBPATH\".\n\n\"Cwd::extLibpathset( path [, type ] )\"\nSet current value of extended library search path. If \"type\" is present and positive,\nworks with <ENDLIBPATH>, if negative, works with \"LIBPATHSTRICT\", otherwise with\n\"BEGINLIBPATH\".\n\n\"OS2::Error(doharderror,doexception)\"\nReturns   \"undef\" if it was not called yet, otherwise bit 1 is set if on the previous\ncall doharderror was enabled, bit 2 is set if on previous call doexception was enabled.\n\nThis function enables/disables error popups associated with hardware errors (Disk not\nready etc.) and software exceptions.\n\nI know of no way to find out the state of popups before the first call to this function.\n\n\"OS2::Errors2Drive(drive)\"\nReturns \"undef\" if it was not called yet, otherwise return false if errors were not\nrequested to be written to a hard drive, or the drive letter if this was requested.\n\nThis function may redirect error popups associated with hardware errors (Disk not ready\netc.) and software exceptions to the file POPUPLOG.OS2 at the root directory of the\nspecified drive.  Overrides OS2::Error() specified by individual programs.  Given\nargument undef will disable redirection.\n\nHas global effect, persists after the application exits.\n\nI know of no way to find out the state of redirection of popups to the disk before the\nfirst call to this function.\n"
                    },
                    {
                        "name": "OS2::SysInfo()",
                        "content": "Returns a hash with system information. The keys of the hash are\n\nMAXPATHLENGTH, MAXTEXTSESSIONS, MAXPMSESSIONS,\nMAXVDMSESSIONS, BOOTDRIVE, DYNPRIVARIATION,\nMAXWAIT, MINSLICE, MAXSLICE, PAGESIZE,\nVERSIONMAJOR, VERSIONMINOR, VERSIONREVISION,\nMSCOUNT, TIMELOW, TIMEHIGH, TOTPHYSMEM, TOTRESMEM,\nTOTAVAILMEM, MAXPRMEM, MAXSHMEM, TIMERINTERVAL,\nMAXCOMPLENGTH, FOREGROUNDFSSESSION,\nFOREGROUNDPROCESS\n"
                    },
                    {
                        "name": "OS2::BootDrive()",
                        "content": "Returns a letter without colon.\n\n\"OS2::MorphPM(serve)\", \"OS2::UnMorphPM(serve)\"\nTransforms the current application into a PM application and back.  The argument true\nmeans that a real message loop is going to be served.  OS2::MorphPM() returns the PM\nmessage queue handle as an integer.\n\nSee \"Centralized management of resources\" for additional details.\n\n\"OS2::ServeMessages(force)\"\nFake on-demand retrieval of outstanding PM messages.  If \"force\" is false, will not\ndispatch messages if a real message loop is known to be present.  Returns number of\nmessages retrieved.\n\nDies with \"QUITing...\" if WMQUIT message is obtained.\n\n\"OS2::ProcessMessages(force [, cnt])\"\nRetrieval of PM messages until window creation/destruction.  If \"force\" is false, will\nnot dispatch messages if a real message loop is known to be present.\n\nReturns change in number of windows.  If \"cnt\" is given, it is incremented by the number\nof messages retrieved.\n\nDies with \"QUITing...\" if WMQUIT message is obtained.\n\n\"OS2::control87(new,mask)\"\nthe same as control87(3) of EMX.  Takes integers as arguments, returns the previous\ncoprocessor control word as an integer.  Only bits in \"new\" which are present in \"mask\"\nare changed in the control word.\n\nOS2::getcontrol87()\ngets the coprocessor control word as an integer.\n\n\"OS2::setcontrol87em(new=MCWEM,mask=MCWEM)\"\nThe variant of OS2::control87() with default values good for handling exception mask: if\nno \"mask\", uses exception mask part of \"new\" only.  If no \"new\", disables all the\nfloating point exceptions.\n\nSee \"Misfeatures\" for details.\n\n\"OS2::DLLname([how [, \\&xsub]])\"\nGives the information about the Perl DLL or the DLL containing the C function bound to by\n&xsub.  The meaning of \"how\" is: default (2): full name; 0: handle; 1: module name.\n\n(Note that some of these may be moved to different libraries - eventually).\n"
                    },
                    {
                        "name": "Prebuilt variables:",
                        "content": "$OS2::emxrev\nnumeric value is the same as emxrev of EMX, a string value the same as emxvprt\n(similar to \"0.9c\").\n\n$OS2::emxenv\nsame as emxenv of EMX, a number similar to 0x8001.\n\n$OS2::osver\na number \"OSMAJOR + 0.001 * OSMINOR\".\n\n$OS2::isaout\ntrue if the Perl library was compiled in AOUT format.\n\n$OS2::canfork\ntrue if the current executable is an AOUT EMX executable, so Perl can fork.  Do not use\nthis, use the portable check for $Config::Config{dfork}.\n\n$OS2::nsyserror\nThis variable (default is 1) controls whether to enforce the contents of $^E to start\nwith \"SYS0003\"-like id.  If set to 0, then the string value of $^E is what is available\nfrom the OS/2 message file.  (Some messages in this file have an \"SYS0003\"-like id\nprepended, some not.)\n"
                    },
                    {
                        "name": "Misfeatures",
                        "content": "•   Since flock(3) is present in EMX, but is not functional, it is emulated by perl.  To\ndisable the emulations, set environment variable \"USEPERLFLOCK=0\".\n\n•   Here is the list of things which may be \"broken\" on EMX (from EMX docs):\n\n•   The functions recvmsg(3), sendmsg(3), and socketpair(3) are not implemented.\n\n•   sockinit(3) is not required and not implemented.\n\n•   flock(3) is not yet implemented (dummy function).  (Perl has a workaround.)\n\n•   kill(3):  Special treatment of PID=0, PID=1 and PID=-1 is not implemented.\n\n•   waitpid(3):\n\nWUNTRACED\nNot implemented.\nwaitpid() is not implemented for negative values of PID.\n\nNote that \"kill -9\" does not work with the current version of EMX.\n\n•   See \"Text-mode filehandles\".\n\n•   Unix-domain sockets on OS/2 live in a pseudo-file-system \"/sockets/...\".  To avoid a\nfailure to create a socket with a name of a different form, \"/socket/\" is prepended to\nthe socket name (unless it starts with this already).\n\nThis may lead to problems later in case the socket is accessed via the \"usual\" file-\nsystem calls using the \"initial\" name.\n\n•   Apparently, IBM used a compiler (for some period of time around '95?) which changes FP\nmask right and left.  This is not that bad for IBM's programs, but the same compiler was\nused for DLLs which are used with general-purpose applications.  When these DLLs are\nused, the state of floating-point flags in the application is not predictable.\n\nWhat is much worse, some DLLs change the floating point flags when in DLLInitTerm()\n(e.g., TCP32IP).  This means that even if you do not call any function in the DLL, just\nthe act of loading this DLL will reset your flags.  What is worse, the same compiler was\nused to compile some HOOK DLLs.  Given that HOOK dlls are executed in the context of all\nthe applications in the system, this means a complete unpredictability of floating point\nflags on systems using such HOOK DLLs.  E.g., GAMESRVR.DLL of DIVE origin changes the\nfloating point flags on each write to the TTY of a VIO (windowed text-mode) applications.\n\nSome other (not completely debugged) situations when FP flags change include some video\ndrivers (?), and some operations related to creation of the windows.  People who code\nOpenGL may have more experience on this.\n\nPerl is generally used in the situation when all the floating-point exceptions are\nignored, as is the default under EMX.  If they are not ignored, some benign Perl programs\nwould get a \"SIGFPE\" and would die a horrible death.\n\nTo circumvent this, Perl uses two hacks.  They help against one type of damage only: FP\nflags changed when loading a DLL.\n\nOne of the hacks is to disable floating point exceptions on Perl startup (as is the\ndefault with EMX).  This helps only with compile-time-linked DLLs changing the flags\nbefore main() had a chance to be called.\n\nThe other hack is to restore FP flags after a call to dlopen().  This helps against\nsimilar damage done by DLLs DLLInitTerm() at runtime.  Currently no way to switch these\nhacks off is provided.\n"
                    },
                    {
                        "name": "Modifications",
                        "content": "Perl modifies some standard C library calls in the following ways:\n\n\"popen\"  \"mypopen\" uses sh.exe if shell is required, cf. \"\"PERLSHDIR\"\".\n\n\"tmpnam\" is created using \"TMP\" or \"TEMP\" environment variable, via \"tempnam\".\n\n\"tmpfile\"\nIf the current directory is not writable, file is created using modified \"tmpnam\",\nso there may be a race condition.\n\n\"ctermid\"\na dummy implementation.\n\n\"stat\"   \"os2stat\" special-cases /dev/tty and /dev/con.\n\n\"mkdir\", \"rmdir\"\nthese EMX functions do not work if the path contains a trailing \"/\".  Perl contains\na workaround for this.\n\n\"flock\"  Since flock(3) is present in EMX, but is not functional, it is emulated by perl.  To\ndisable the emulations, set environment variable \"USEPERLFLOCK=0\".\n"
                    },
                    {
                        "name": "Identifying DLLs",
                        "content": "All the DLLs built with the current versions of Perl have ID strings identifying the name of\nthe extension, its version, and the version of Perl required for this DLL.  Run \"bldlevel\nDLL-name\" to find this info.\n"
                    },
                    {
                        "name": "Centralized management of resources",
                        "content": "Since to call certain OS/2 API one needs to have a correctly initialized \"Win\" subsystem,\nOS/2-specific extensions may require getting \"HAB\"s and \"HMQ\"s.  If an extension would do it\non its own, another extension could fail to initialize.\n\nPerl provides a centralized management of these resources:\n\n\"HAB\"\nTo get the HAB, the extension should call \"hab = perlhabGET()\" in C.  After this call\nis performed, \"hab\" may be accessed as \"Perlhab\".  There is no need to release the HAB\nafter it is used.\n\nIf by some reasons perl.h cannot be included, use\n\nextern int PerlhabGET(void);\n\ninstead.\n\n\"HMQ\"\nThere are two cases:\n\n•   the extension needs an \"HMQ\" only because some API will not work otherwise.  Use\n\"serve = 0\" below.\n\n•   the extension needs an \"HMQ\" since it wants to engage in a PM event loop.  Use \"serve\n= 1\" below.\n\nTo get an \"HMQ\", the extension should call \"hmq = perlhmqGET(serve)\" in C.  After this\ncall is performed, \"hmq\" may be accessed as \"Perlhmq\".\n\nTo signal to Perl that HMQ is not needed any more, call \"perlhmqUNSET(serve)\".  Perl\nprocess will automatically morph/unmorph itself into/from a PM process if HMQ is\nneeded/not-needed.  Perl will automatically enable/disable \"WMQUIT\" message during\nshutdown if the message queue is served/not-served.\n\nNOTE.  If during a shutdown there is a message queue which did not disable WMQUIT, and\nwhich did not process the received WMQUIT message, the shutdown will be automatically\ncancelled.  Do not call perlhmqGET(1) unless you are going to process messages on an\norderly basis.\n\nTreating errors reported by OS/2 API\nThere are two principal conventions (it is useful to call them \"Dos*\" and \"Win*\" - though\nthis part of the function signature is not always determined by the name of the API) of\nreporting the error conditions of OS/2 API.  Most of \"Dos*\" APIs report the error code as\nthe result of the call (so 0 means success, and there are many types of errors).  Most of\n\"Win*\" API report success/fail via the result being \"TRUE\"/\"FALSE\"; to find the reason\nfor the failure one should call WinGetLastError() API.\n\nSome \"Win*\" entry points also overload a \"meaningful\" return value with the error\nindicator; having a 0 return value indicates an error.  Yet some other \"Win*\" entry\npoints overload things even more, and 0 return value may mean a successful call returning\na valid value 0, as well as an error condition; in the case of a 0 return value one\nshould call WinGetLastError() API to distinguish a successful call from a failing one.\n\nBy convention, all the calls to OS/2 API should indicate their failures by resetting $^E.\nAll the Perl-accessible functions which call OS/2 API may be broken into two classes:\nsome die()s when an API error is encountered, the other report the error via a false\nreturn value (of course, this does not concern Perl-accessible functions which expect a\nfailure of the OS/2 API call, having some workarounds coded).\n\nObviously, in the situation of the last type of the signature of an OS/2 API, it is must\nmore convenient for the users if the failure is indicated by die()ing: one does not need\nto check $^E to know that something went wrong.  If, however, this solution is not\ndesirable by some reason, the code in question should reset $^E to 0 before making this\nOS/2 API call, so that the caller of this Perl-accessible function has a chance to\ndistinguish a success-but-0-return value from a failure.  (One may return undef as an\nalternative way of reporting an error.)\n\nThe macros to simplify this type of error propagation are\n\n\"CheckOSError(expr)\"\nReturns true on error, sets $^E.  Expects expr() be a call of \"Dos*\"-style API.\n\n\"CheckWinError(expr)\"\nReturns true on error, sets $^E.  Expects expr() be a call of \"Win*\"-style API.\n\n\"SaveWinError(expr)\"\nReturns \"expr\", sets $^E from WinGetLastError() if \"expr\" is false.\n\n\"SaveCroakWinError(expr,die,name1,name2)\"\nReturns \"expr\", sets $^E from WinGetLastError() if \"expr\" is false, and die()s if\n\"die\" and $^E are true.  The message to die is the concatenated strings \"name1\" and\n\"name2\", separated by \": \" from the contents of $^E.\n\n\"WinError2Perlrc\"\nSets \"Perlrc\" to the return value of WinGetLastError().\n\n\"FillWinError\"\nSets \"Perlrc\" to the return value of WinGetLastError(), and sets $^E to the\ncorresponding value.\n\n\"FillOSError(rc)\"\nSets \"Perlrc\" to \"rc\", and sets $^E to the corresponding value.\n\nLoading DLLs and ordinals in DLLs\nSome DLLs are only present in some versions of OS/2, or in some configurations of OS/2.\nSome exported entry points are present only in DLLs shipped with some versions of OS/2.\nIf these DLLs and entry points were linked directly for a Perl executable/DLL or from a\nPerl extensions, this binary would work only with the specified versions/setups.  Even if\nthese entry points were not needed, the load of the executable (or DLL) would fail.\n\nFor example, many newer useful APIs are not present in OS/2 v2; many PM-related APIs\nrequire DLLs not available on floppy-boot setup.\n\nTo make these calls fail only when the calls are executed, one should call these API via\na dynamic linking API.  There is a subsystem in Perl to simplify such type of calls.  A\nlarge number of entry points available for such linking is provided (see\n\"entriesordinals\" - and also \"PMWINentries\" - in os2ish.h).  These ordinals can be\naccessed via the APIs:\n\nCallORD(), DeclFuncByORD(), DeclVoidFuncByORD(),\nDeclOSFuncByORD(), DeclWinFuncByORD(), AssignFuncPByORD(),\nDeclWinFuncByORDCACHE(), DeclWinFuncByORDCACHEsurvive(),\nDeclWinFuncByORDCACHEresetErrorsurvive(),\nDeclWinFuncCACHE(), DeclWinFuncCACHEresetError(),\nDeclWinFuncCACHEsurvive(), DeclWinFuncCACHEresetErrorsurvive()\n\nSee the header files and the C code in the supplied OS/2-related modules for the details\non usage of these functions.\n\nSome of these functions also combine dynaloading semantic with the error-propagation\nsemantic discussed above.\n"
                    },
                    {
                        "name": "Perl flavors",
                        "content": "Because of idiosyncrasies of OS/2 one cannot have all the eggs in the same basket (though EMX\nenvironment tries hard to overcome this limitations, so the situation may somehow improve).\nThere are 4 executables for Perl provided by the distribution:\n\nperl.exe\nThe main workhorse. This is a chimera executable: it is compiled as an \"a.out\"-style\nexecutable, but is linked with \"omf\"-style dynamic library perl.dll, and with dynamic CRT\nDLL. This executable is a VIO application.\n\nIt can load perl dynamic extensions, and it can fork().\n\nNote. Keep in mind that fork() is needed to open a pipe to yourself.\n\nperl.exe\nThis is a statically linked \"a.out\"-style executable. It cannot load dynamic Perl extensions.\nThe executable supplied in binary distributions has a lot of extensions prebuilt, thus the\nabove restriction is important only if you use custom-built extensions. This executable is a\nVIO application.\n\nThis is the only executable with does not require OS/2. The friends locked into \"M$\" world\nwould appreciate the fact that this executable runs under DOS, Win0.3*, Win0.95 and WinNT\nwith an appropriate extender. See \"Other OSes\".\n\nperl.exe\nThis is the same executable as perl.exe, but it is a PM application.\n\nNote. Usually (unless explicitly redirected during the startup) STDIN, STDERR, and STDOUT of\na PM application are redirected to nul. However, it is possible to see them if you start\n\"perl.exe\" from a PM program which emulates a console window, like Shell mode of Emacs or\nEPM. Thus it is possible to use Perl debugger (see perldebug) to debug your PM application\n(but beware of the message loop lockups - this will not work if you have a message queue to\nserve, unless you hook the serving into the getc() function of the debugger).\n\nAnother way to see the output of a PM program is to run it as\n\npmprog args 2>&1 | cat -\n\nwith a shell different from cmd.exe, so that it does not create a link between a VIO session\nand the session of \"pmporg\".  (Such a link closes the VIO window.)  E.g., this works with\nsh.exe - or with Perl!\n\nopen P, 'pmprog args 2>&1 |' or die;\nprint while <P>;\n\nThe flavor perl.exe is required if you want to start your program without a VIO window\npresent, but not \"detach\"ed (run \"help detach\" for more info).  Very useful for extensions\nwhich use PM, like \"Perl/Tk\" or \"OpenGL\".\n\nNote also that the differences between PM and VIO executables are only in the default\nbehaviour.  One can start any executable in any kind of session by using the arguments \"/fs\",\n\"/pm\" or \"/win\" switches of the command \"start\" (of CMD.EXE or a similar shell).\nAlternatively, one can use the numeric first argument of the \"system\" Perl function (see\nOS2::Process).\n\nperl.exe\nThis is an \"omf\"-style executable which is dynamically linked to perl.dll and CRT DLL. I know\nno advantages of this executable over \"perl.exe\", but it cannot fork() at all. Well, one\nadvantage is that the build process is not so convoluted as with \"perl.exe\".\n\nIt is a VIO application.\n"
                    },
                    {
                        "name": "Why strange names?",
                        "content": "Since Perl processes the \"#!\"-line (cf.  \"DESCRIPTION\" in perlrun, \"Command Switches\" in\nperlrun, \"No Perl script found in input\" in perldiag), it should know when a program is a\nPerl. There is some naming convention which allows Perl to distinguish correct lines from\nwrong ones. The above names are almost the only names allowed by this convention which do not\ncontain digits (which have absolutely different semantics).\n"
                    },
                    {
                        "name": "Why dynamic linking?",
                        "content": "Well, having several executables dynamically linked to the same huge library has its\nadvantages, but this would not substantiate the additional work to make it compile. The\nreason is the complicated-to-developers but very quick and convenient-to-users \"hard\" dynamic\nlinking used by OS/2.\n\nThere are two distinctive features of the dyna-linking model of OS/2: first, all the\nreferences to external functions are resolved at the compile time; second, there is no\nruntime fixup of the DLLs after they are loaded into memory.  The first feature is an\nenormous advantage over other models: it avoids conflicts when several DLLs used by an\napplication export entries with the same name.  In such cases \"other\" models of dyna-linking\njust choose between these two entry points using some random criterion - with predictable\ndisasters as results.  But it is the second feature which requires the build of perl.dll.\n\nThe address tables of DLLs are patched only once, when they are loaded. The addresses of the\nentry points into DLLs are guaranteed to be the same for all the programs which use the same\nDLL.  This removes the runtime fixup - once DLL is loaded, its code is read-only.\n\nWhile this allows some (significant?) performance advantages, this makes life much harder for\ndevelopers, since the above scheme makes it impossible for a DLL to be \"linked\" to a symbol\nin the .EXE file.  Indeed, this would need a DLL to have different relocations tables for the\n(different) executables which use this DLL.\n\nHowever, a dynamically loaded Perl extension is forced to use some symbols from the perl\nexecutable, e.g., to know how to find the arguments to the functions: the arguments live on\nthe perl internal evaluation stack. The solution is to put the main code of the interpreter\ninto a DLL, and make the .EXE file which just loads this DLL into memory and supplies\ncommand-arguments.  The extension DLL cannot link to symbols in .EXE, but it has no problem\nlinking to symbols in the .DLL.\n\nThis greatly increases the load time for the application (as well as complexity of the\ncompilation). Since interpreter is in a DLL, the C RTL is basically forced to reside in a DLL\nas well (otherwise extensions would not be able to use CRT).  There are some advantages if\nyou use different flavors of perl, such as running perl.exe and perl.exe simultaneously:\nthey share the memory of perl.dll.\n\nNOTE.  There is one additional effect which makes DLLs more wasteful: DLLs are loaded in the\nshared memory region, which is a scarse resource given the 512M barrier of the \"standard\"\nOS/2 virtual memory.  The code of .EXE files is also shared by all the processes which use\nthe particular .EXE, but they are \"shared in the private address space of the process\"; this\nis possible because the address at which different sections of the .EXE file are loaded is\ndecided at compile-time, thus all the processes have these sections loaded at same addresses,\nand no fixup of internal links inside the .EXE is needed.\n\nSince DLLs may be loaded at run time, to have the same mechanism for DLLs one needs to have\nthe address range of any of the loaded DLLs in the system to be available in all the\nprocesses which did not load a particular DLL yet.  This is why the DLLs are mapped to the\nshared memory region.\n"
                    },
                    {
                        "name": "Why chimera build?",
                        "content": "Current EMX environment does not allow DLLs compiled using Unixish \"a.out\" format to export\nsymbols for data (or at least some types of data). This forces \"omf\"-style compile of\nperl.dll.\n\nCurrent EMX environment does not allow .EXE files compiled in \"omf\" format to fork(). fork()\nis needed for exactly three Perl operations:\n\n•   explicit fork() in the script,\n\n•   \"open FH, \"|-\"\"\n\n•   \"open FH, \"-|\"\", in other words, opening pipes to itself.\n\nWhile these operations are not questions of life and death, they are needed for a lot of\nuseful scripts. This forces \"a.out\"-style compile of perl.exe.\n"
                    }
                ]
            },
            "ENVIRONMENT": {
                "content": "Here we list environment variables with are either OS/2- and DOS- and Win*-specific, or are\nmore important under OS/2 than under other OSes.\n\n\"PERLLIBPREFIX\"\nSpecific for EMX port. Should have the form\n\npath1;path2\n\nor\n\npath1 path2\n\nIf the beginning of some prebuilt path matches path1, it is substituted with path2.\n\nShould be used if the perl library is moved from the default location in preference to\n\"PERL(5)LIB\", since this would not leave wrong entries in @INC.  For example, if the compiled\nversion of perl looks for @INC in f:/perllib/lib, and you want to install the library in\nh:/opt/gnu, do\n\nset PERLLIBPREFIX=f:/perllib/lib;h:/opt/gnu\n\nThis will cause Perl with the prebuilt @INC of\n\nf:/perllib/lib/5.00553/os2\nf:/perllib/lib/5.00553\nf:/perllib/lib/siteperl/5.00553/os2\nf:/perllib/lib/siteperl/5.00553\n.\n\nto use the following @INC:\n\nh:/opt/gnu/5.00553/os2\nh:/opt/gnu/5.00553\nh:/opt/gnu/siteperl/5.00553/os2\nh:/opt/gnu/siteperl/5.00553\n.\n\n\"PERLBADLANG\"\nIf 0, perl ignores setlocale() failing. May be useful with some strange locales.\n\n\"PERLBADFREE\"\nIf 0, perl would not warn of in case of unwarranted free(). With older perls this might be\nuseful in conjunction with the module DBFile, which was buggy when dynamically linked and\nOMF-built.\n\nShould not be set with newer Perls, since this may hide some real problems.\n\n\"PERLSHDIR\"\nSpecific for EMX port. Gives the directory part of the location for sh.exe.\n\n\"USEPERLFLOCK\"\nSpecific for EMX port. Since flock(3) is present in EMX, but is not functional, it is\nemulated by perl.  To disable the emulations, set environment variable \"USEPERLFLOCK=0\".\n",
                "subsections": [
                    {
                        "name": "\"TMP\" or \"TEMP\"",
                        "content": "Specific for EMX port. Used as storage place for temporary files.\n"
                    }
                ]
            },
            "Evolution": {
                "content": "Here we list major changes which could make you by surprise.\n",
                "subsections": [
                    {
                        "name": "Text-mode filehandles",
                        "content": "Starting from version 5.8, Perl uses a builtin translation layer for text-mode files.  This\nreplaces the efficient well-tested EMX layer by some code which should be best characterized\nas a \"quick hack\".\n\nIn addition to possible bugs and an inability to follow changes to the translation policy\nwith off/on switches of TERMIO translation, this introduces a serious incompatible change:\nbefore sysread() on text-mode filehandles would go through the translation layer, now it\nwould not.\n"
                    },
                    {
                        "name": "Priorities",
                        "content": "\"setpriority\" and \"getpriority\" are not compatible with earlier ports by Andreas Kaiser. See\n\"setpriority, getpriority\".\n"
                    },
                    {
                        "name": "DLL name mangling: pre 5.6.2",
                        "content": "With the release 5.00301 the dynamically loadable libraries should be rebuilt when a\ndifferent version of Perl is compiled. In particular, DLLs (including perl.dll) are now\ncreated with the names which contain a checksum, thus allowing workaround for OS/2 scheme of\ncaching DLLs.\n\nIt may be possible to code a simple workaround which would\n\n•   find the old DLLs looking through the old @INC;\n\n•   mangle the names according to the scheme of new perl and copy the DLLs to these names;\n\n•   edit the internal \"LX\" tables of DLL to reflect the change of the name (probably not\nneeded for Perl extension DLLs, since the internally coded names are not used for\n\"specific\" DLLs, they used only for \"global\" DLLs).\n\n•   edit the internal \"IMPORT\" tables and change the name of the \"old\" perl????.dll to the\n\"new\" perl????.dll.\n"
                    },
                    {
                        "name": "DLL name mangling: 5.6.2 and beyond",
                        "content": "In fact mangling of extension DLLs was done due to misunderstanding of the OS/2 dynaloading\nmodel.  OS/2 (effectively) maintains two different tables of loaded DLL:\n\nGlobal DLLs\nthose loaded by the base name from \"LIBPATH\"; including those associated at link time;\n\nspecific DLLs\nloaded by the full name.\n\nWhen resolving a request for a global DLL, the table of already-loaded specific DLLs is\n(effectively) ignored; moreover, specific DLLs are always loaded from the prescribed path.\n\nThere is/was a minor twist which makes this scheme fragile: what to do with DLLs loaded from\n\n\"BEGINLIBPATH\" and \"ENDLIBPATH\"\n(which depend on the process)\n\n. from \"LIBPATH\"\nwhich effectively depends on the process (although \"LIBPATH\" is the same for all the\nprocesses).\n\nUnless \"LIBPATHSTRICT\" is set to \"T\" (and the kernel is after 2000/09/01), such DLLs are\nconsidered to be global.  When loading a global DLL it is first looked in the table of\nalready-loaded global DLLs.  Because of this the fact that one executable loaded a DLL from\n\"BEGINLIBPATH\" and \"ENDLIBPATH\", or . from \"LIBPATH\" may affect which DLL is loaded when\nanother executable requests a DLL with the same name.  This is the reason for version-\nspecific mangling of the DLL name for perl DLL.\n\nSince the Perl extension DLLs are always loaded with the full path, there is no need to\nmangle their names in a version-specific ways: their directory already reflects the\ncorresponding version of perl, and @INC takes into account binary compatibility with older\nversion.  Starting from 5.6.2 the name mangling scheme is fixed to be the same as for Perl\n5.00553 (same as in a popular binary release).  Thus new Perls will be able to resolve the\nnames of old extension DLLs if @INC allows finding their directories.\n\nHowever, this still does not guarantee that these DLL may be loaded.  The reason is the\nmangling of the name of the Perl DLL.  And since the extension DLLs link with the Perl DLL,\nextension DLLs for older versions would load an older Perl DLL, and would most probably\nsegfault (since the data in this DLL is not properly initialized).\n\nThere is a partial workaround (which can be made complete with newer OS/2 kernels): create a\nforwarder DLL with the same name as the DLL of the older version of Perl, which forwards the\nentry points to the newer Perl's DLL.  Make this DLL accessible on (say) the \"BEGINLIBPATH\"\nof the new Perl executable.  When the new executable accesses old Perl's extension DLLs, they\nwould request the old Perl's DLL by name, get the forwarder instead, so effectively will link\nwith the currently running (new) Perl DLL.\n\nThis may break in two ways:\n\n•   Old perl executable is started when a new executable is running has loaded an extension\ncompiled for the old executable (ouph!).  In this case the old executable will get a\nforwarder DLL instead of the old perl DLL, so would link with the new perl DLL.  While\nnot directly fatal, it will behave the same as new executable.  This beats the whole\npurpose of explicitly starting an old executable.\n\n•   A new executable loads an extension compiled for the old executable when an old perl\nexecutable is running.  In this case the extension will not pick up the forwarder - with\nfatal results.\n\nWith support for \"LIBPATHSTRICT\" this may be circumvented - unless one of DLLs is started\nfrom . from \"LIBPATH\" (I do not know whether \"LIBPATHSTRICT\" affects this case).\n\nREMARK.  Unless newer kernels allow . in \"BEGINLIBPATH\" (older do not), this mess cannot be\ncompletely cleaned.  (It turns out that as of the beginning of 2002, . is not allowed, but\n.\\. is - and it has the same effect.)\n\nREMARK.  \"LIBPATHSTRICT\", \"BEGINLIBPATH\" and \"ENDLIBPATH\" are not environment variables,\nalthough cmd.exe emulates them on \"SET ...\" lines.  From Perl they may be accessed by\nCwd::extLibpath and Cwd::extLibpathset.\n"
                    },
                    {
                        "name": "DLL forwarder generation",
                        "content": "Assume that the old DLL is named perlE0AC.dll (as is one for 5.00553), and the new version\nis 5.6.1.  Create a file perl5shim.def-leader with\n\nLIBRARY 'perlE0AC' INITINSTANCE TERMINSTANCE\nDESCRIPTION '@#perl5-porters@perl.org:5.006001#@ Perl module for 5.00553 -> Perl 5.6.1 forwarder'\nCODE LOADONCALL\nDATA LOADONCALL NONSHARED MULTIPLE\nEXPORTS\n\nmodifying the versions/names as needed.  Run\n\nperl -wnle \"next if 0../EXPORTS/; print qq(  \\\"$1\\\")\nif /\\\"(\\w+)\\\"/\" perl5.def >lst\n\nin the Perl build directory (to make the DLL smaller replace perl5.def with the definition\nfile for the older version of Perl if present).\n\ncat perl5shim.def-leader lst >perl5shim.def\ngcc -Zomf -Zdll -o perlE0AC.dll perl5shim.def -s -llibperl\n\n(ignore multiple \"warning L4085\").\n"
                    },
                    {
                        "name": "Threading",
                        "content": "As of release 5.00301 perl is linked to multithreaded C RTL DLL.  If perl itself is not\ncompiled multithread-enabled, so will not be perl's malloc(). However, extensions may use\nmultiple thread on their own risk.\n\nThis was needed to compile \"Perl/Tk\" for XFree86-OS/2 out-of-the-box, and link with DLLs for\nother useful libraries, which typically are compiled with \"-Zmt -Zcrtdll\".\n"
                    },
                    {
                        "name": "Calls to external programs",
                        "content": "Due to a popular demand the perl external program calling has been changed wrt Andreas\nKaiser's port.  If perl needs to call an external program via shell, the f:/bin/sh.exe will\nbe called, or whatever is the override, see \"\"PERLSHDIR\"\".\n\nThus means that you need to get some copy of a sh.exe as well (I use one from pdksh). The\npath F:/bin above is set up automatically during the build to a correct value on the builder\nmachine, but is overridable at runtime,\n\nReasons: a consensus on \"perl5-porters\" was that perl should use one non-overridable shell\nper platform. The obvious choices for OS/2 are cmd.exe and sh.exe. Having perl build itself\nwould be impossible with cmd.exe as a shell, thus I picked up \"sh.exe\". This assures almost\n100% compatibility with the scripts coming from *nix. As an added benefit this works as well\nunder DOS if you use DOS-enabled port of pdksh (see \"Prerequisites\").\n\nDisadvantages: currently sh.exe of pdksh calls external programs via fork()/exec(), and there\nis no functioning exec() on OS/2. exec() is emulated by EMX by an asynchronous call while the\ncaller waits for child completion (to pretend that the \"pid\" did not change). This means that\n1 extra copy of sh.exe is made active via fork()/exec(), which may lead to some resources\ntaken from the system (even if we do not count extra work needed for fork()ing).\n\nNote that this a lesser issue now when we do not spawn sh.exe unless needed (metachars\nfound).\n\nOne can always start cmd.exe explicitly via\n\nsystem 'cmd', '/c', 'mycmd', 'arg1', 'arg2', ...\n\nIf you need to use cmd.exe, and do not want to hand-edit thousands of your scripts, the long-\nterm solution proposed on p5-p is to have a directive\n\nuse OS2::Cmd;\n\nwhich will override system(), exec(), \"``\", and \"open(,'...|')\". With current perl you may\noverride only system(), readpipe() - the explicit version of \"``\", and maybe exec(). The code\nwill substitute the one-argument call to system() by \"CORE::system('cmd.exe', '/c', shift)\".\n\nIf you have some working code for \"OS2::Cmd\", please send it to me, I will include it into\ndistribution. I have no need for such a module, so cannot test it.\n\nFor the details of the current situation with calling external programs, see \"Starting OS/2\n(and DOS) programs under Perl\".  Set us mention a couple of features:\n\n•   External scripts may be called by their basename.  Perl will try the same extensions as\nwhen processing -S command-line switch.\n\n•   External scripts starting with \"#!\" or \"extproc \" will be executed directly, without\ncalling the shell, by calling the program specified on the rest of the first line.\n"
                    },
                    {
                        "name": "Memory allocation",
                        "content": "Perl uses its own malloc() under OS/2 - interpreters are usually malloc-bound for speed, but\nperl is not, since its malloc is lightning-fast.  Perl-memory-usage-tuned benchmarks show\nthat Perl's malloc is 5 times quicker than EMX one.  I do not have convincing data about\nmemory footprint, but a (pretty random) benchmark showed that Perl's one is 5% better.\n\nCombination of perl's malloc() and rigid DLL name resolution creates a special problem with\nlibrary functions which expect their return value to be free()d by system's free(). To\nfacilitate extensions which need to call such functions, system memory-allocation functions\nare still available with the prefix \"emx\" added. (Currently only DLL perl has this, it\nshould propagate to perl.exe shortly.)\n"
                    },
                    {
                        "name": "Threads",
                        "content": "One can build perl with thread support enabled by providing \"-D usethreads\" option to\nConfigure.  Currently OS/2 support of threads is very preliminary.\n\nMost notable problems:\n\n\"CONDWAIT\"\nmay have a race condition (but probably does not due to edge-triggered nature of OS/2\nEvent semaphores).  (Needs a reimplementation (in terms of chaining waiting threads, with\nthe linked list stored in per-thread structure?)?)\n\nos2.c\nhas a couple of static variables used in OS/2-specific functions.  (Need to be moved to\nper-thread structure, or serialized?)\n\nNote that these problems should not discourage experimenting, since they have a low\nprobability of affecting small programs.\n"
                    }
                ]
            },
            "BUGS": {
                "content": "This description is not updated often (since 5.6.1?), see ./os2/Changes for more info.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Ilya Zakharevich, cpan@ilyaz.org\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "perl(1).\n\n\n\nperl v5.34.0                                 2025-07-25                                   PERLOS2(1)",
                "subsections": []
            }
        }
    }
}