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