{
    "content": [
        {
            "type": "text",
            "text": "# perldos (man)\n\n## NAME\n\nperldos - Perl under DOS, W31, W95.\n\n## SYNOPSIS\n\nThese are instructions for building Perl under DOS (or w??), using DJGPP v2.03 or later.\nUnder w95 long filenames are supported.\n\n## DESCRIPTION\n\nBefore you start, you should glance through the README file found in the top-level directory\nwhere the Perl distribution was extracted.  Make sure you read and understand the terms under\nwhich this software is being distributed.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (5 subsections)\n- **BUILDING AND INSTALLING MODULES ON DOS** (4 subsections)\n- **AUTHOR**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "perldos",
        "section": "",
        "mode": "man",
        "summary": "perldos - Perl under DOS, W31, W95.",
        "synopsis": "These are instructions for building Perl under DOS (or w??), using DJGPP v2.03 or later.\nUnder w95 long filenames are supported.",
        "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": 3,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 11,
                "subsections": [
                    {
                        "name": "Prerequisites for Compiling Perl on DOS",
                        "lines": 37
                    },
                    {
                        "name": "Shortcomings of Perl under DOS",
                        "lines": 11
                    },
                    {
                        "name": "Building Perl on DOS",
                        "lines": 77
                    },
                    {
                        "name": "Testing Perl on DOS",
                        "lines": 8
                    },
                    {
                        "name": "Installation of Perl on DOS",
                        "lines": 8
                    }
                ]
            },
            {
                "name": "BUILDING AND INSTALLING MODULES ON DOS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "Building Prerequisites for Perl on DOS",
                        "lines": 14
                    },
                    {
                        "name": "Unpacking CPAN Modules on DOS",
                        "lines": 22
                    },
                    {
                        "name": "Building Non-XS Modules on DOS",
                        "lines": 12
                    },
                    {
                        "name": "Building XS Modules on DOS",
                        "lines": 28
                    }
                ]
            },
            {
                "name": "AUTHOR",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "perldos - Perl under DOS, W31, W95.\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "These are instructions for building Perl under DOS (or w??), using DJGPP v2.03 or later.\nUnder w95 long filenames are supported.\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Before you start, you should glance through the README file found in the top-level directory\nwhere the Perl distribution was extracted.  Make sure you read and understand the terms under\nwhich this software is being distributed.\n\nThis port currently supports MakeMaker (the set of modules that is used to build extensions\nto perl).  Therefore, you should be able to build and install most extensions found in the\nCPAN sites.\n\nDetailed instructions on how to build and install perl extension modules, including XS-type\nmodules, is included.  See 'BUILDING AND INSTALLING MODULES'.\n",
                "subsections": [
                    {
                        "name": "Prerequisites for Compiling Perl on DOS",
                        "content": "DJGPP\nDJGPP is a port of GNU C/C++ compiler and development tools to 32-bit, protected-mode\nenvironment on Intel 32-bit CPUs running MS-DOS and compatible operating systems, by DJ\nDelorie <dj@delorie.com> and friends.\n\nFor more details (FAQ), check out the home of DJGPP at:\n\nhttp://www.delorie.com/djgpp/\n\nIf you have questions about DJGPP, try posting to the DJGPP newsgroup:\ncomp.os.msdos.djgpp, or use the email gateway djgpp@delorie.com.\n\nYou can find the full DJGPP distribution on any of the mirrors listed here:\n\nhttp://www.delorie.com/djgpp/getting.html\n\nYou need the following files to build perl (or add new modules):\n\nv2/djdev203.zip\nv2gnu/bnu2112b.zip\nv2gnu/gcc2953b.zip\nv2gnu/bsh204b.zip\nv2gnu/mak3791b.zip\nv2gnu/fil40b.zip\nv2gnu/sed3028b.zip\nv2gnu/txt20b.zip\nv2gnu/dif272b.zip\nv2gnu/grep24b.zip\nv2gnu/shl20jb.zip\nv2gnu/gwk306b.zip\nv2misc/csdpmi5b.zip\n\nor possibly any newer version.\n\nPthreads\nThread support is not tested in this version of the djgpp perl.\n"
                    },
                    {
                        "name": "Shortcomings of Perl under DOS",
                        "content": "Perl under DOS lacks some features of perl under UNIX because of deficiencies in the UNIX-\nemulation, most notably:\n\n•   fork() and pipe()\n\n•   some features of the UNIX filesystem regarding link count and file dates\n\n•   in-place operation is a little bit broken with short filenames\n\n•   sockets\n"
                    },
                    {
                        "name": "Building Perl on DOS",
                        "content": "•   Unpack the source package perl5.8*.tar.gz with djtarx. If you want to use long file names\nunder w95 and also to get Perl to pass all its tests, don't forget to use\n\nset LFN=y\nset FNCASE=y\n\nbefore unpacking the archive.\n\n•   Create a \"symlink\" or copy your bash.exe to sh.exe in your \"($DJDIR)/bin\" directory.\n\nln -s bash.exe sh.exe\n\n[If you have the recommended version of bash for DJGPP, this is already done for you.]\n\nAnd make the \"SHELL\" environment variable point to this sh.exe:\n\nset SHELL=c:/djgpp/bin/sh.exe (use full path name!)\n\nYou can do this in djgpp.env too. Add this line BEFORE any section definition:\n\n+SHELL=%DJDIR%/bin/sh.exe\n\n•   If you have split.exe and gsplit.exe in your path, then rename split.exe to djsplit.exe,\nand gsplit.exe to split.exe.  Copy or link gecho.exe to echo.exe if you don't have\necho.exe.  Copy or link gawk.exe to awk.exe if you don't have awk.exe.\n\n[If you have the recommended versions of djdev, shell utilities and gawk, all these are\nalready done for you, and you will not need to do anything.]\n\n•   Chdir to the djgpp subdirectory of perl toplevel and type the following commands:\n\nset FNCASE=y\nconfigure.bat\n\nThis will do some preprocessing then run the Configure script for you.  The Configure\nscript is interactive, but in most cases you just need to press ENTER.  The \"set\" command\nensures that DJGPP preserves the letter case of file names when reading directories.  If\nyou already issued this set command when unpacking the archive, and you are in the same\nDOS session as when you unpacked the archive, you don't have to issue the set command\nagain.  This command is necessary *before* you start to (re)configure or (re)build perl\nin order to ensure both that perl builds correctly and that building XS-type modules can\nsucceed.  See the DJGPP info entry for \"preservefncase\" for more information:\n\ninfo libc alphabetical preservefncase\n\nIf the script says that your package is incomplete, and asks whether to continue, just\nanswer with Y (this can only happen if you don't use long filenames or forget to issue\n\"set FNCASE=y\" first).\n\nWhen Configure asks about the extensions, I suggest IO and Fcntl, and if you want\ndatabase handling then SDBMFile or GDBMFile (you need to install gdbm for this one). If\nyou want to use the POSIX extension (this is the default), make sure that the stack size\nof your cc1.exe is at least 512kbyte (you can check this with: \"stubedit cc1.exe\").\n\nYou can use the Configure script in non-interactive mode too.  When I built my perl.exe,\nI used something like this:\n\nconfigure.bat -des\n\nYou can find more info about Configure's command line switches in the INSTALL file.\n\nWhen the script ends, and you want to change some values in the generated config.sh file,\nthen run\n\nsh Configure -S\n\nafter you made your modifications.\n\nIMPORTANT: if you use this \"-S\" switch, be sure to delete the CONFIG environment variable\nbefore running the script:\n\nset CONFIG=\n\n•   Now you can compile Perl. Type:\n\nmake\n"
                    },
                    {
                        "name": "Testing Perl on DOS",
                        "content": "Type:\n\nmake test\n\nIf you're lucky you should see \"All tests successful\". But there can be a few failed subtests\n(less than 5 hopefully) depending on some external conditions (e.g. some subtests fail under\nlinux/dosemu or plain dos with short filenames only).\n"
                    },
                    {
                        "name": "Installation of Perl on DOS",
                        "content": "Type:\n\nmake install\n\nThis will copy the newly compiled perl and libraries into your DJGPP directory structure.\nPerl.exe and the utilities go into \"($DJDIR)/bin\", and the library goes under\n\"($DJDIR)/lib/perl5\". The pod documentation goes under \"($DJDIR)/lib/perl5/pod\".\n"
                    }
                ]
            },
            "BUILDING AND INSTALLING MODULES ON DOS": {
                "content": "",
                "subsections": [
                    {
                        "name": "Building Prerequisites for Perl on DOS",
                        "content": "For building and installing non-XS modules, all you need is a working perl under DJGPP.  Non-\nXS modules do not require re-linking the perl binary, and so are simpler to build and\ninstall.\n\nXS-type modules do require re-linking the perl binary, because part of an XS module is\nwritten in \"C\", and has to be linked together with the perl binary to be executed.  This is\nrequired because perl under DJGPP is built with the \"static link\" option, due to the lack of\n\"dynamic linking\" in the DJGPP environment.\n\nBecause XS modules require re-linking of the perl binary, you need both the perl binary\ndistribution and the perl source distribution to build an XS extension module.  In addition,\nyou will have to have built your perl binary from the source distribution so that all of the\ncomponents of the perl binary are available for the required link step.\n"
                    },
                    {
                        "name": "Unpacking CPAN Modules on DOS",
                        "content": "First, download the module package from CPAN (e.g., the \"Comma Separated Value\" text package,\nText-CSV-0.01.tar.gz).  Then expand the contents of the package into some location on your\ndisk.  Most CPAN modules are built with an internal directory structure, so it is usually\nsafe to expand it in the root of your DJGPP installation.  Some people prefer to locate\nsource trees under /usr/src (i.e., \"($DJDIR)/usr/src\"), but you may put it wherever seems\nmost logical to you, *EXCEPT* under the same directory as your perl source code.  There are\nspecial rules that apply to modules which live in the perl source tree that do not apply to\nmost of the modules in CPAN.\n\nUnlike other DJGPP packages, which are normal \"zip\" files, most CPAN module packages are\n\"gzipped tarballs\".  Recent versions of WinZip will safely unpack and expand them, *UNLESS*\nthey have zero-length files.  It is a known WinZip bug (as of v7.0) that it will not extract\nzero-length files.\n\nFrom the command line, you can use the djtar utility provided with DJGPP to unpack and expand\nthese files.  For example:\n\nC:\\djgpp>djtarx -v Text-CSV-0.01.tar.gz\n\nThis will create the new directory \"($DJDIR)/Text-CSV-0.01\", filling it with the source for\nthis module.\n"
                    },
                    {
                        "name": "Building Non-XS Modules on DOS",
                        "content": "To build a non-XS module, you can use the standard module-building instructions distributed\nwith perl modules.\n\nperl Makefile.PL\nmake\nmake test\nmake install\n\nThis is sufficient because non-XS modules install only \".pm\" files and (sometimes) pod and/or\nman documentation.  No re-linking of the perl binary is needed to build, install or use non-\nXS modules.\n"
                    },
                    {
                        "name": "Building XS Modules on DOS",
                        "content": "To build an XS module, you must use the standard module-building instructions distributed\nwith perl modules *PLUS* three extra instructions specific to the DJGPP \"static link\" build\nenvironment.\n\nset FNCASE=y\nperl Makefile.PL\nmake\nmake perl\nmake test\nmake -f Makefile.aperl instperl MAPTARGET=perl.exe\nmake install\n\nThe first extra instruction sets DJGPP's FNCASE environment variable so that the new perl\nbinary which you must build for an XS-type module will build correctly.  The second extra\ninstruction re-builds the perl binary in your module directory before you run \"make test\", so\nthat you are testing with the new module code you built with \"make\".  The third extra\ninstruction installs the perl binary from your module directory into the standard DJGPP\nbinary directory, \"($DJDIR)/bin\", replacing your previous perl binary.\n\nNote that the MAPTARGET value *must* have the \".exe\" extension or you will not create a\n\"perl.exe\" to replace the one in \"($DJDIR)/bin\".\n\nWhen you are done, the XS-module install process will have added information to your\n\"perllocal\" information telling that the perl binary has been replaced, and what module was\ninstalled.  You can view this information at any time by using the command:\n\nperl -S perldoc perllocal\n"
                    }
                ]
            },
            "AUTHOR": {
                "content": "Laszlo Molnar, laszlo.molnar@eth.ericsson.se [Installing/building perl]\n\nPeter J. Farley III pjfarley@banet.net [Building/installing modules]\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "perl(1).\n\n\n\nperl v5.34.0                                 2025-07-25                                   PERLDOS(1)",
                "subsections": []
            }
        }
    }
}