2021-05-04 01:59:31 +00:00
|
|
|
# Perl
|
2012-06-12 23:39:45 +00:00
|
|
|
|
2018-04-16 22:51:57 +00:00
|
|
|
Enables local [Perl][1] module installation on macOS and defines aliases.
|
2012-06-12 23:39:45 +00:00
|
|
|
|
2021-05-04 01:59:31 +00:00
|
|
|
## Local Module Installation
|
2012-06-12 23:39:45 +00:00
|
|
|
|
|
|
|
Perl versions older than 5.14 do not support the local installation of Perl
|
|
|
|
modules natively. This module allows for local installation of Perl modules on
|
2021-05-05 17:59:01 +00:00
|
|
|
macOS in _`~/Library/Perl/5.12`_ by altering the environment.
|
2012-06-12 23:39:45 +00:00
|
|
|
|
|
|
|
### Usage
|
|
|
|
|
2021-05-05 17:59:01 +00:00
|
|
|
For Perl versions older than 5.14, install _`local::lib`_.
|
2012-06-12 23:39:45 +00:00
|
|
|
|
2017-07-21 01:07:29 +00:00
|
|
|
```console
|
|
|
|
curl -L -C - -O http://search.cpan.org/CPAN/authors/id/A/AP/APEIRON/local-lib-1.008004.tar.gz
|
|
|
|
tar xvf local-lib-1.008004.tar.gz
|
|
|
|
cd local-lib-1.008004
|
|
|
|
perl Makefile.PL --bootstrap=$HOME/Library/Perl/5.12
|
|
|
|
make && make test && make install
|
|
|
|
```
|
2012-06-12 23:39:45 +00:00
|
|
|
|
2021-05-05 17:59:01 +00:00
|
|
|
Install _cpanminus_:
|
2012-06-12 23:39:45 +00:00
|
|
|
|
2017-07-21 01:07:29 +00:00
|
|
|
```console
|
|
|
|
curl -L http://cpanmin.us | perl - --self-upgrade
|
|
|
|
```
|
2012-06-12 23:39:45 +00:00
|
|
|
|
2021-05-04 01:59:31 +00:00
|
|
|
## Perlbrew
|
2012-06-12 23:39:45 +00:00
|
|
|
|
|
|
|
An alternative to the above is to use [Perlbrew][2], which allows for the
|
|
|
|
management of multiple, isolated Perl installations in the home directory.
|
|
|
|
|
2021-05-04 01:59:31 +00:00
|
|
|
## plenv
|
2017-04-18 08:57:35 +00:00
|
|
|
|
2021-05-05 17:59:01 +00:00
|
|
|
Yet another alternative is [_plenv_][3]. This is inspired from _rbenv_ and
|
2021-05-04 01:59:31 +00:00
|
|
|
enables switching between multiple binary installations.
|
2017-04-18 08:57:35 +00:00
|
|
|
|
2021-05-05 17:59:01 +00:00
|
|
|
The subcommands of _plenv_ is similar with _rbenv_.
|
2017-04-18 08:57:35 +00:00
|
|
|
|
2021-05-04 01:59:31 +00:00
|
|
|
## Aliases
|
2012-06-12 23:39:45 +00:00
|
|
|
|
|
|
|
### General
|
|
|
|
|
2021-05-04 01:59:31 +00:00
|
|
|
- `pl` is short for `perl`.
|
|
|
|
- `pld` looks up Perl documentation (`perldoc`).
|
|
|
|
- `ple` executes a one line program in a loop (`perl -wlne`).
|
|
|
|
|
|
|
|
### Perlbrew (plb)
|
|
|
|
|
|
|
|
- `plb` manages Perl environments.
|
|
|
|
- `plba` lists available Perl versions.
|
|
|
|
- `plbi` installs a Perl version.
|
|
|
|
- `plbl` lists installed Perl versions.
|
|
|
|
- `plbo` temporarily turns off Perlbrew.
|
|
|
|
- `plbO` turns off Perlbrew.
|
|
|
|
- `plbs` switches to a Perl version.
|
|
|
|
- `plbu` uninstalls a Perl version.
|
|
|
|
- `plbx` temporarily sets the Perl version to use.
|
|
|
|
|
|
|
|
### plenv (plv)
|
|
|
|
|
|
|
|
- `plv` manages Perl environments.
|
|
|
|
- `plvc` List all available plenv commands.
|
|
|
|
- `plvl` Set or show the local application-specific Perl version.
|
|
|
|
- `plvg` Set or show the global Perl version.
|
|
|
|
- `plvs` Set or show the shell-specific Perl version.
|
|
|
|
- `plvi` Install a Perl version using the perl-build plugin.
|
|
|
|
- `plvu` Uninstall a specific Perl version.
|
|
|
|
- `plvr` Rehash plenv shims (run this after installing executables).
|
|
|
|
- `plvv` Show the current Perl version and its origin.
|
|
|
|
- `plvV` List all Perl versions available to plenv.
|
|
|
|
- `plvw` Display the full path to an executable.
|
|
|
|
- `plvW` List all Perl versions that contain the given executable.
|
|
|
|
- `plvm` List cpan modules in current perl.
|
|
|
|
- `plvM` Migrate cpan modules from other version.
|
|
|
|
- `plvI` Install cpanm.
|
|
|
|
|
|
|
|
## Functions
|
|
|
|
|
|
|
|
- `perl-info` exposes information about the Perl environment via the
|
|
|
|
`$perl_info` associative array.
|
|
|
|
|
|
|
|
## Theming
|
2017-04-18 08:57:35 +00:00
|
|
|
|
2017-07-21 01:07:29 +00:00
|
|
|
To display the name of the current Perl version in a prompt, define the
|
2017-04-18 08:57:35 +00:00
|
|
|
following style in the `prompt_name_setup` function.
|
|
|
|
|
2017-07-21 01:07:29 +00:00
|
|
|
```sh
|
|
|
|
# %v - perl version.
|
|
|
|
zstyle ':prezto:module:perl:info:version' format 'version:%v'
|
|
|
|
```
|
2017-04-18 08:57:35 +00:00
|
|
|
|
|
|
|
Then add `$perl_info[version]` to `$PROMPT` or `$RPROMPT` and call
|
|
|
|
`perl-info` in the `prompt_name_precmd` hook function.
|
|
|
|
|
2021-05-04 01:59:31 +00:00
|
|
|
## Authors
|
2012-06-12 23:39:45 +00:00
|
|
|
|
2021-05-05 17:59:01 +00:00
|
|
|
_The authors of this module should be contacted via the [issue tracker][4]._
|
2012-06-12 23:39:45 +00:00
|
|
|
|
2021-05-04 01:59:31 +00:00
|
|
|
- [Sorin Ionescu](https://github.com/sorin-ionescu)
|
2012-06-12 23:39:45 +00:00
|
|
|
|
2021-05-04 01:59:31 +00:00
|
|
|
[1]: https://www.perl.org
|
|
|
|
[2]: https://perlbrew.pl
|
2017-04-18 08:57:35 +00:00
|
|
|
[3]: https://github.com/tokuhirom/plenv
|
|
|
|
[4]: https://github.com/sorin-ionescu/prezto/issues
|