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