]>
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) | |
7 | - [Required Perl modules](#required-perl-modules) | |
8 | - [Notes on installing a Perl module](#notes-on-installing-a-perl-module]) | |
d36ab9ce | 9 | |
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 | ||
55 | Required Perl modules | |
56 | --------------------- | |
d36ab9ce | 57 | |
dc589dae DMSP |
58 | We do our best to limit ourselves to core Perl modules to keep the |
59 | requirements down. There are just a few exceptions. | |
d36ab9ce | 60 | |
d36ab9ce | 61 | |
dc589dae | 62 | ## For Building |
f578075a | 63 | |
dc589dae | 64 | * `Text::Template` |
f578075a | 65 | |
dc589dae DMSP |
66 | This module is not part of the core Perl modules. |
67 | As a matter of fact, the core Perl modules do not | |
68 | include any templating module to date. | |
69 | This module is absolutely needed, | |
70 | configuration depends on it. | |
d36ab9ce | 71 | |
dc589dae | 72 | ## For Testing |
d36ab9ce | 73 | |
dc589dae | 74 | * `Test::More` |
d36ab9ce | 75 | |
dc589dae DMSP |
76 | We require the minimum version to be 0.96, which |
77 | appeared in Perl 5.13.4, because that version was | |
78 | the first to have all the features we're using. | |
79 | This module is required for testing only! | |
80 | If you don't plan on running the tests, | |
81 | you don't need to bother with this one. | |
1dc1ea18 | 82 | |
1dc1ea18 | 83 | |
d36ab9ce | 84 | |
dc589dae DMSP |
85 | To avoid unnecessary initial hurdles, we have bundled a copy of the |
86 | following modules in our source. They will work as fallbacks if | |
87 | these modules aren't already installed on the system. | |
d36ab9ce | 88 | |
dc589dae | 89 | Text::Template |
d36ab9ce | 90 | |
dc589dae DMSP |
91 | Notes on installing a Perl module |
92 | --------------------------------- | |
d36ab9ce | 93 | |
dc589dae DMSP |
94 | There are a number of ways to install a perl module. In all |
95 | descriptions below, `Text::Template` will serve as an example. | |
d36ab9ce | 96 | |
dc589dae DMSP |
97 | 1. for Linux users, the easiest is to install with the use of your |
98 | favorite package manager. Usually, all you need to do is search | |
99 | for the module name and to install the package that comes up. | |
d36ab9ce | 100 | |
dc589dae | 101 | On Debian based Linux distributions, it would go like this: |
d36ab9ce | 102 | |
dc589dae DMSP |
103 | $ apt-cache search Text::Template |
104 | ... | |
105 | libtext-template-perl - perl module to process text templates | |
106 | $ sudo apt-get install libtext-template-perl | |
d36ab9ce | 107 | |
dc589dae DMSP |
108 | Perl modules in Debian based distributions use package names like |
109 | the name of the module in question, with "lib" prepended and | |
110 | "-perl" appended. | |
d36ab9ce | 111 | |
dc589dae DMSP |
112 | 2. Install using CPAN. This is very easy, but usually requires root |
113 | access: | |
d36ab9ce | 114 | |
dc589dae | 115 | $ cpan -i Text::Template |
d36ab9ce | 116 | |
dc589dae DMSP |
117 | Note that this runs all the tests that the module to be installed |
118 | comes with. This is usually a smooth operation, but there are | |
119 | platforms where a failure is indicated even though the actual tests | |
120 | were successful. Should that happen, you can force an | |
121 | installation regardless (that should be safe since you've already | |
122 | seen the tests succeed!): | |
d36ab9ce | 123 | |
dc589dae | 124 | $ cpan -f -i Text::Template |
f578075a | 125 | |
dc589dae DMSP |
126 | Note: on VMS, you must quote any argument that contains upper case |
127 | characters, so the lines above would be: | |
f578075a | 128 | |
dc589dae | 129 | $ cpan -i "Text::Template" |
f578075a | 130 | |
dc589dae | 131 | and: |
f578075a | 132 | |
dc589dae | 133 | $ cpan -f -i "Text::Template" |