2
0

NOTES.PERL 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. TOC
  2. ===
  3. - Notes on Perl
  4. - Notes on Perl on Windows
  5. - Notes on Perl modules we use
  6. - Notes on installing a perl module
  7. Notes on Perl
  8. -------------
  9. For our scripts, we rely quite a bit on Perl, and increasingly on
  10. some core Perl modules. These Perl modules are part of the Perl
  11. source, so if you build Perl on your own, you should be set.
  12. However, if you install Perl as binary packages, the outcome might
  13. differ, and you may have to check that you do get the core modules
  14. installed properly. We do not claim to know them all, but experience
  15. has told us the following:
  16. - on Linux distributions based on Debian, the package 'perl' will
  17. install the core Perl modules as well, so you will be fine.
  18. - on Linux distributions based on RPMs, you will need to install
  19. 'perl-core' rather than just 'perl'.
  20. You MUST have at least Perl version 5.10.0 installed. This minimum
  21. requirement is due to our use of regexp backslash sequence \R among
  22. other features that didn't exist in core Perl before that version.
  23. Notes on Perl on Windows
  24. ------------------------
  25. There are a number of build targets that can be viewed as "Windows".
  26. Indeed, there are VC-* configs targeting VisualStudio C, as well as
  27. MinGW and Cygwin. The key recommendation is to use "matching" Perl,
  28. one that matches build environment. For example, if you will build
  29. on Cygwin be sure to use the Cygwin package manager to install Perl.
  30. For MSYS builds use the MSYS provided Perl. For VC-* builds we
  31. recommend ActiveState Perl, available from
  32. http://www.activestate.com/ActivePerl.
  33. Notes on Perl on VMS
  34. --------------------
  35. You will need to install Perl separately. One way to do so is to
  36. download the source from http://perl.org/, unpacking it, reading
  37. README.vms and follow the instructions. Another way is to download a
  38. .PCSI file from http://www.vmsperl.com/ and install it using the
  39. POLYCENTER install tool.
  40. Notes on Perl modules we use
  41. ----------------------------
  42. We make increasing use of Perl modules, and do our best to limit
  43. ourselves to core Perl modules to keep the requirements down. There
  44. are just a few exceptions:
  45. Test::More We require the minimum version to be 0.96, which
  46. appeared in Perl 5.13.4, because that version was
  47. the first to have all the features we're using.
  48. This module is required for testing only! If you
  49. don't plan on running the tests, you don't need to
  50. bother with this one.
  51. Text::Template This module is not part of the core Perl modules.
  52. As a matter of fact, the core Perl modules do not
  53. include any templating module to date.
  54. This module is absolutely needed, configuration
  55. depends on it.
  56. To avoid unnecessary initial hurdles, we have bundled a copy of the
  57. following modules in our source. They will work as fallbacks if
  58. these modules aren't already installed on the system.
  59. Text::Template
  60. Notes on installing a perl module
  61. ---------------------------------
  62. There are a number of ways to install a perl module. In all
  63. descriptions below, Text::Template will serve as an example.
  64. 1. for Linux users, the easiest is to install with the use of your
  65. favorite package manager. Usually, all you need to do is search
  66. for the module name and to install the package that comes up.
  67. On Debian based Linux distributions, it would go like this:
  68. $ apt-cache search Text::Template
  69. ...
  70. libtext-template-perl - perl module to process text templates
  71. $ sudo apt-get install libtext-template-perl
  72. Perl modules in Debian based distributions use package names like
  73. the name of the module in question, with "lib" prepended and
  74. "-perl" appended.
  75. 2. Install using CPAN. This is very easy, but usually requires root
  76. access:
  77. $ cpan -i Text::Template
  78. Note that this runs all the tests that the module to be installed
  79. comes with. This is usually a smooth operation, but there are
  80. platforms where a failure is indicated even though the actual tests
  81. were successful. Should that happen, you can force an
  82. installation regardless (that should be safe since you've already
  83. seen the tests succeed!):
  84. $ cpan -f -i Text::Template
  85. Note: on VMS, you must quote any argument that contains upper case
  86. characters, so the lines above would be:
  87. $ cpan -i "Text::Template"
  88. and:
  89. $ cpan -f -i "Text::Template"