1*b0d17251SchristosNotes on Perl 2*b0d17251Schristos============= 3*b0d17251Schristos 4*b0d17251Schristos - [General Notes](#general-notes) 5*b0d17251Schristos - [Perl on Windows](#perl-on-windows) 6*b0d17251Schristos - [Perl on VMS](#perl-on-vms) 7*b0d17251Schristos - [Perl on NonStop](#perl-on-nonstop) 8*b0d17251Schristos - [Required Perl modules](#required-perl-modules) 9*b0d17251Schristos - [Notes on installing a Perl module](#notes-on-installing-a-perl-module]) 10*b0d17251Schristos 11*b0d17251SchristosGeneral Notes 12*b0d17251Schristos------------- 13*b0d17251Schristos 14*b0d17251SchristosFor our scripts, we rely quite a bit on Perl, and increasingly on 15*b0d17251Schristossome core Perl modules. These Perl modules are part of the Perl 16*b0d17251Schristossource, so if you build Perl on your own, you should be set. 17*b0d17251Schristos 18*b0d17251SchristosHowever, if you install Perl as binary packages, the outcome might 19*b0d17251Schristosdiffer, and you may have to check that you do get the core modules 20*b0d17251Schristosinstalled properly. We do not claim to know them all, but experience 21*b0d17251Schristoshas told us the following: 22*b0d17251Schristos 23*b0d17251Schristos - on Linux distributions based on Debian, the package `perl` will 24*b0d17251Schristos install the core Perl modules as well, so you will be fine. 25*b0d17251Schristos - on Linux distributions based on RPMs, you will need to install 26*b0d17251Schristos `perl-core` rather than just `perl`. 27*b0d17251Schristos 28*b0d17251SchristosYou MUST have at least Perl version 5.10.0 installed. This minimum 29*b0d17251Schristosrequirement is due to our use of regexp backslash sequence \R among 30*b0d17251Schristosother features that didn't exist in core Perl before that version. 31*b0d17251Schristos 32*b0d17251SchristosPerl on Windows 33*b0d17251Schristos--------------- 34*b0d17251Schristos 35*b0d17251SchristosThere are a number of build targets that can be viewed as "Windows". 36*b0d17251SchristosIndeed, there are `VC-*` configs targeting VisualStudio C, as well as 37*b0d17251SchristosMinGW and Cygwin. The key recommendation is to use a Perl installation 38*b0d17251Schristosthat matches the build environment. For example, if you will build 39*b0d17251Schristoson Cygwin be sure to use the Cygwin package manager to install Perl. 40*b0d17251SchristosFor MSYS builds use the MSYS provided Perl. 41*b0d17251SchristosFor VC-* builds we recommend Strawberry Perl, from <http://strawberryperl.com>. 42*b0d17251SchristosAn alternative is ActiveState Perl, from <http://www.activestate.com/ActivePerl> 43*b0d17251Schristosfor which you may need to explicitly select the Perl module Win32/Console.pm 44*b0d17251Schristosavailable via <https://platform.activestate.com/ActiveState>. 45*b0d17251Schristos 46*b0d17251SchristosPerl on VMS 47*b0d17251Schristos----------- 48*b0d17251Schristos 49*b0d17251SchristosYou will need to install Perl separately. One way to do so is to 50*b0d17251Schristosdownload the source from <http://perl.org/>, unpacking it, reading 51*b0d17251Schristos`README-VMS.md` and follow the instructions. Another way is to download a 52*b0d17251Schristos`.PCSI` file from <http://www.vmsperl.com/> and install it using the 53*b0d17251SchristosPOLYCENTER install tool. 54*b0d17251Schristos 55*b0d17251SchristosPerl on NonStop 56*b0d17251Schristos--------------- 57*b0d17251Schristos 58*b0d17251SchristosPerl is installed on HPE NonStop platforms as part of the Scripting Languages 59*b0d17251Schristospackage T1203PAX file. The package is shipped as part of a NonStop RVU 60*b0d17251Schristos(Release Version Updates) package. Individual SPRs (Software Product Release) 61*b0d17251Schristosrepresenting fixes can be obtained from the Scout website at 62*b0d17251Schristos<https://h22204.www2.hpe.com/NEP>. Follow the appropriate set of installation 63*b0d17251Schristosinstructions for your operating system release as described in the 64*b0d17251SchristosScript Language User Guide available from the NonStop Technical Library. 65*b0d17251Schristos 66*b0d17251SchristosRequired Perl modules 67*b0d17251Schristos--------------------- 68*b0d17251Schristos 69*b0d17251SchristosWe do our best to limit ourselves to core Perl modules to keep the 70*b0d17251Schristosrequirements down. There are just a few exceptions. 71*b0d17251Schristos 72*b0d17251Schristos * Text::Template this is required *for building* 73*b0d17251Schristos 74*b0d17251Schristos To avoid unnecessary initial hurdles, we include a copy of this module 75*b0d17251Schristos in the source. It will work as a fallback if the module isn't already 76*b0d17251Schristos installed. 77*b0d17251Schristos 78*b0d17251Schristos * `Test::More` this is required *for testing* 79*b0d17251Schristos 80*b0d17251Schristos We require the minimum version to be 0.96, which appeared in Perl 5.13.4, 81*b0d17251Schristos because that version was the first to have all the features we're using. 82*b0d17251Schristos This module is required for testing only! If you don't plan on running 83*b0d17251Schristos the tests, you don't need to bother with this one. 84*b0d17251Schristos 85*b0d17251SchristosNotes on installing a Perl module 86*b0d17251Schristos--------------------------------- 87*b0d17251Schristos 88*b0d17251SchristosThere are a number of ways to install a perl module. In all 89*b0d17251Schristosdescriptions below, `Text::Template` will serve as an example. 90*b0d17251Schristos 91*b0d17251Schristos1. for Linux users, the easiest is to install with the use of your 92*b0d17251Schristos favorite package manager. Usually, all you need to do is search 93*b0d17251Schristos for the module name and to install the package that comes up. 94*b0d17251Schristos 95*b0d17251Schristos On Debian based Linux distributions, it would go like this: 96*b0d17251Schristos 97*b0d17251Schristos $ apt-cache search Text::Template 98*b0d17251Schristos ... 99*b0d17251Schristos libtext-template-perl - perl module to process text templates 100*b0d17251Schristos $ sudo apt-get install libtext-template-perl 101*b0d17251Schristos 102*b0d17251Schristos Perl modules in Debian based distributions use package names like 103*b0d17251Schristos the name of the module in question, with "lib" prepended and 104*b0d17251Schristos "-perl" appended. 105*b0d17251Schristos 106*b0d17251Schristos2. Install using CPAN. This is very easy, but usually requires root 107*b0d17251Schristos access: 108*b0d17251Schristos 109*b0d17251Schristos $ cpan -i Text::Template 110*b0d17251Schristos 111*b0d17251Schristos Note that this runs all the tests that the module to be installed 112*b0d17251Schristos comes with. This is usually a smooth operation, but there are 113*b0d17251Schristos platforms where a failure is indicated even though the actual tests 114*b0d17251Schristos were successful. Should that happen, you can force an 115*b0d17251Schristos installation regardless (that should be safe since you've already 116*b0d17251Schristos seen the tests succeed!): 117*b0d17251Schristos 118*b0d17251Schristos $ cpan -f -i Text::Template 119*b0d17251Schristos 120*b0d17251Schristos Note: on VMS, you must quote any argument that contains upper case 121*b0d17251Schristos characters, so the lines above would be: 122*b0d17251Schristos 123*b0d17251Schristos $ cpan -i "Text::Template" 124*b0d17251Schristos 125*b0d17251Schristos and: 126*b0d17251Schristos 127*b0d17251Schristos $ cpan -f -i "Text::Template" 128