Linux command
plenv 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
List installed versions
plenv versions
Show current version
plenv version
Set global version
plenv global [5.38.0]
Set local version
plenv local [5.36.0]
Install Perl version
plenv install [5.38.0]
List available versions
plenv install --list
Install cpanm
plenv install-cpanm
Rehash shims
plenv rehash
说明
plenv manages multiple Perl versions. It installs versions to ~/.plenv and uses shims to route commands to the correct Perl. Version selection prioritizes: PLENV_VERSION environment variable, .perl-version file in current/parent directories, global setting. Local version creates .perl-version file for project-specific Perl. Entering the directory automatically switches versions. Installation uses Perl-Build to compile from source. Build options can customize the installation. cpanm installation provides a module installer that works with all managed Perl versions. Run rehash after installing modules with executables. The design mirrors rbenv, providing consistent version management across languages for developers familiar with that pattern.
参数
- install _VERSION_
- Install Perl version.
- install --list
- List available versions.
- versions
- List installed versions.
- version
- Show current version.
- global _VERSION_
- Set/show global version.
- local _VERSION_
- Set/show local version.
- shell _VERSION_
- Set shell-specific version.
- rehash
- Rebuild shim executables.
- which _CMD_
- Show command path.
- exec _CMD_
- Run with current Perl.
- install-cpanm
- Install cpanminus.
FAQ
What is the plenv command used for?
plenv manages multiple Perl versions. It installs versions to ~/.plenv and uses shims to route commands to the correct Perl. Version selection prioritizes: PLENV_VERSION environment variable, .perl-version file in current/parent directories, global setting. Local version creates .perl-version file for project-specific Perl. Entering the directory automatically switches versions. Installation uses Perl-Build to compile from source. Build options can customize the installation. cpanm installation provides a module installer that works with all managed Perl versions. Run rehash after installing modules with executables. The design mirrors rbenv, providing consistent version management across languages for developers familiar with that pattern.
How do I run a basic plenv example?
Run `plenv versions` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does install _VERSION_ do in plenv?
Install Perl version.