| 
									
										
										
										
											2021-02-02 01:53:29 +08:00
										 |  |  | Notes on Perl | 
					
						
							|  |  |  | ============= | 
					
						
							| 
									
										
										
										
											2016-01-21 21:43:51 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-02 01:53:29 +08:00
										 |  |  |  - [General Notes](#general-notes) | 
					
						
							|  |  |  |  - [Perl on Windows](#perl-on-windows) | 
					
						
							|  |  |  |  - [Perl on VMS](#perl-on-vms) | 
					
						
							| 
									
										
										
										
											2021-04-20 01:32:36 +08:00
										 |  |  |  - [Perl on NonStop](#perl-on-nonstop) | 
					
						
							| 
									
										
										
										
											2021-02-02 01:53:29 +08:00
										 |  |  |  - [Required Perl modules](#required-perl-modules) | 
					
						
							|  |  |  |  - [Notes on installing a Perl module](#notes-on-installing-a-perl-module]) | 
					
						
							| 
									
										
										
										
											2016-01-21 21:43:51 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-02 01:53:29 +08:00
										 |  |  | General Notes | 
					
						
							|  |  |  | ------------- | 
					
						
							| 
									
										
										
										
											2016-01-21 21:43:51 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-02 01:53:29 +08:00
										 |  |  | For our scripts, we rely quite a bit on Perl, and increasingly on | 
					
						
							|  |  |  | some core Perl modules.  These Perl modules are part of the Perl | 
					
						
							|  |  |  | source, so if you build Perl on your own, you should be set. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | However, if you install Perl as binary packages, the outcome might | 
					
						
							|  |  |  | differ, and you may have to check that you do get the core modules | 
					
						
							|  |  |  | installed properly.  We do not claim to know them all, but experience | 
					
						
							|  |  |  | has told us the following: | 
					
						
							| 
									
										
										
										
											2016-01-21 21:43:51 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-10 23:49:25 +08:00
										 |  |  |  - on Linux distributions based on Debian, the package `perl` will | 
					
						
							| 
									
										
										
										
											2016-01-21 21:43:51 +08:00
										 |  |  |    install the core Perl modules as well, so you will be fine. | 
					
						
							|  |  |  |  - on Linux distributions based on RPMs, you will need to install | 
					
						
							| 
									
										
										
										
											2020-06-10 23:49:25 +08:00
										 |  |  |    `perl-core` rather than just `perl`. | 
					
						
							| 
									
										
										
										
											2016-01-21 21:43:51 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-02 01:53:29 +08:00
										 |  |  | You MUST have at least Perl version 5.10.0 installed.  This minimum | 
					
						
							|  |  |  | requirement is due to our use of regexp backslash sequence \R among | 
					
						
							|  |  |  | other features that didn't exist in core Perl before that version. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Perl on Windows | 
					
						
							|  |  |  | --------------- | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | There are a number of build targets that can be viewed as "Windows". | 
					
						
							| 
									
										
										
										
											2022-09-22 19:27:27 +08:00
										 |  |  | Indeed, there are `VC-*` configs targeting Visual Studio C, as well as | 
					
						
							| 
									
										
										
										
											2021-02-02 01:53:29 +08:00
										 |  |  | MinGW and Cygwin. The key recommendation is to use a Perl installation | 
					
						
							|  |  |  | that matches the build environment. For example, if you will build | 
					
						
							|  |  |  | on Cygwin be sure to use the Cygwin package manager to install Perl. | 
					
						
							|  |  |  | For MSYS builds use the MSYS provided Perl. | 
					
						
							| 
									
										
										
										
											2022-09-22 19:27:27 +08:00
										 |  |  | For VC-* builds, we recommend Strawberry Perl, from <http://strawberryperl.com>. | 
					
						
							| 
									
										
										
										
											2021-02-02 01:53:29 +08:00
										 |  |  | An alternative is ActiveState Perl, from <http://www.activestate.com/ActivePerl> | 
					
						
							|  |  |  | for which you may need to explicitly select the Perl module Win32/Console.pm | 
					
						
							|  |  |  | available via <https://platform.activestate.com/ActiveState>. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Perl on VMS | 
					
						
							|  |  |  | ----------- | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | You will need to install Perl separately.  One way to do so is to | 
					
						
							|  |  |  | download the source from <http://perl.org/>, unpacking it, reading | 
					
						
							|  |  |  | `README-VMS.md` and follow the instructions.  Another way is to download a | 
					
						
							|  |  |  | `.PCSI` file from <http://www.vmsperl.com/> and install it using the | 
					
						
							|  |  |  | POLYCENTER install tool. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-04-20 01:32:36 +08:00
										 |  |  | Perl on NonStop | 
					
						
							|  |  |  | --------------- | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Perl is installed on HPE NonStop platforms as part of the Scripting Languages | 
					
						
							|  |  |  | package T1203PAX file. The package is shipped as part of a NonStop RVU | 
					
						
							|  |  |  | (Release Version Updates) package. Individual SPRs (Software Product Release) | 
					
						
							|  |  |  | representing fixes can be obtained from the Scout website at | 
					
						
							|  |  |  | <https://h22204.www2.hpe.com/NEP>. Follow the appropriate set of installation | 
					
						
							|  |  |  | instructions for your operating system release as described in the | 
					
						
							|  |  |  | Script Language User Guide available from the NonStop Technical Library. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-02 01:53:29 +08:00
										 |  |  | Required Perl modules | 
					
						
							|  |  |  | --------------------- | 
					
						
							| 
									
										
										
										
											2016-01-21 21:43:51 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-02 01:53:29 +08:00
										 |  |  | We do our best to limit ourselves to core Perl modules to keep the | 
					
						
							|  |  |  | requirements down. There are just a few exceptions. | 
					
						
							| 
									
										
										
										
											2016-01-21 21:43:51 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-05-25 22:28:49 +08:00
										 |  |  |  * Text::Template this is required *for building* | 
					
						
							| 
									
										
										
										
											2016-01-21 21:43:51 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-05-25 22:28:49 +08:00
										 |  |  |    To avoid unnecessary initial hurdles, we include a copy of this module | 
					
						
							|  |  |  |    in the source. It will work as a fallback if the module isn't already | 
					
						
							|  |  |  |    installed. | 
					
						
							| 
									
										
										
										
											2016-01-21 21:43:51 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-05-25 22:28:49 +08:00
										 |  |  |  * `Test::More` this is required *for testing* | 
					
						
							| 
									
										
										
										
											2016-01-21 21:43:51 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-05-25 22:28:49 +08:00
										 |  |  |    We require the minimum version to be 0.96, which appeared in Perl 5.13.4, | 
					
						
							|  |  |  |    because that version was the first to have all the features we're using. | 
					
						
							|  |  |  |    This module is required for testing only!  If you don't plan on running | 
					
						
							|  |  |  |    the tests, you don't need to bother with this one. | 
					
						
							| 
									
										
										
										
											2016-01-21 21:43:51 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-02 01:53:29 +08:00
										 |  |  | Notes on installing a Perl module | 
					
						
							|  |  |  | --------------------------------- | 
					
						
							| 
									
										
										
										
											2016-01-21 21:43:51 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-02 01:53:29 +08:00
										 |  |  | There are a number of ways to install a perl module.  In all | 
					
						
							|  |  |  | descriptions below, `Text::Template` will serve as an example. | 
					
						
							| 
									
										
										
										
											2016-01-21 21:43:51 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-02 01:53:29 +08:00
										 |  |  | 1. for Linux users, the easiest is to install with the use of your | 
					
						
							|  |  |  |    favorite package manager.  Usually, all you need to do is search | 
					
						
							|  |  |  |    for the module name and to install the package that comes up. | 
					
						
							| 
									
										
										
										
											2016-01-21 21:43:51 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-02 01:53:29 +08:00
										 |  |  |    On Debian based Linux distributions, it would go like this: | 
					
						
							| 
									
										
										
										
											2016-01-21 21:43:51 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-02 01:53:29 +08:00
										 |  |  |        $ apt-cache search Text::Template | 
					
						
							|  |  |  |        ... | 
					
						
							|  |  |  |        libtext-template-perl - perl module to process text templates | 
					
						
							|  |  |  |        $ sudo apt-get install libtext-template-perl | 
					
						
							| 
									
										
										
										
											2016-01-21 21:43:51 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-02 01:53:29 +08:00
										 |  |  |    Perl modules in Debian based distributions use package names like | 
					
						
							|  |  |  |    the name of the module in question, with "lib" prepended and | 
					
						
							|  |  |  |    "-perl" appended. | 
					
						
							| 
									
										
										
										
											2016-01-21 21:43:51 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-02 01:53:29 +08:00
										 |  |  | 2. Install using CPAN.  This is very easy, but usually requires root | 
					
						
							|  |  |  |    access: | 
					
						
							| 
									
										
										
										
											2016-01-21 21:43:51 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-02 01:53:29 +08:00
										 |  |  |        $ cpan -i Text::Template | 
					
						
							| 
									
										
										
										
											2016-01-21 21:43:51 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-02 01:53:29 +08:00
										 |  |  |    Note that this runs all the tests that the module to be installed | 
					
						
							|  |  |  |    comes with.  This is usually a smooth operation, but there are | 
					
						
							|  |  |  |    platforms where a failure is indicated even though the actual tests | 
					
						
							|  |  |  |    were successful.  Should that happen, you can force an | 
					
						
							|  |  |  |    installation regardless (that should be safe since you've already | 
					
						
							|  |  |  |    seen the tests succeed!): | 
					
						
							| 
									
										
										
										
											2016-01-21 21:43:51 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-02 01:53:29 +08:00
										 |  |  |        $ cpan -f -i Text::Template | 
					
						
							| 
									
										
										
										
											2016-01-30 14:15:59 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-24 02:40:44 +08:00
										 |  |  |    Note: on VMS, you must quote any argument that contains uppercase | 
					
						
							| 
									
										
										
										
											2021-02-02 01:53:29 +08:00
										 |  |  |    characters, so the lines above would be: | 
					
						
							| 
									
										
										
										
											2016-01-30 14:15:59 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-02 01:53:29 +08:00
										 |  |  |        $ cpan -i "Text::Template" | 
					
						
							| 
									
										
										
										
											2016-01-30 14:15:59 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-02 01:53:29 +08:00
										 |  |  |    and: | 
					
						
							| 
									
										
										
										
											2016-01-30 14:15:59 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-02 01:53:29 +08:00
										 |  |  |        $ cpan -f -i "Text::Template" |