Linux command
perlbrew 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Install Perl version
perlbrew install perl-[5.38.0]
List available versions
perlbrew available
List installed versions
perlbrew list
Switch to Perl version
perlbrew switch perl-[5.38.0]
Use version in current shell
perlbrew use perl-[5.38.0]
Install cpanm
perlbrew install-cpanm
Create library
perlbrew lib create perl-[5.38.0]@[mylib]
Run command with specific Perl
perlbrew exec --with perl-[5.38.0] [perl script.pl]
说明
perlbrew manages multiple Perl installations in user space. It enables switching between versions without system access. Installations compile Perl from source in ~/perl5/perlbrew. Each version is independent with its own modules and libraries. Libraries provide isolated module sets for the same Perl version. This enables project-specific dependencies without conflicts. Switch sets the default version for new shells. Use changes only the current shell. This flexibility supports development across versions. cpanm integration simplifies module installation. It's installed once and works with all managed Perl versions. Exec runs commands against specific versions, useful for testing compatibility or building packages.
参数
- install _VERSION_
- Install Perl version.
- available
- List available versions.
- list
- List installed versions.
- switch _VERSION_
- Set default version.
- use _VERSION_
- Use version in current shell.
- off
- Disable perlbrew in current shell.
- lib create _NAME_
- Create library.
- lib list
- List libraries.
- exec _CMD_
- Run command with Perl version.
- uninstall _VERSION_
- Uninstall a Perl version.
- alias _create_ _name_ _alias_
- Give a Perl installation a new name.
- info
- Show perlbrew installation info.
- install-cpanm
- Install cpanminus.
- install-multiple
- Install multiple versions and flavors.
- self-upgrade
- Upgrade perlbrew itself.
- clean
- Purge tarballs and build directories.
- --notest
- Skip tests during install.
- --thread
- Build Perl with usethreads enabled.
- -j _N_
- Parallel build jobs.
- -q, --quiet
- Suppress informative output.
- -v, --verbose
- More verbose output.
FAQ
What is the perlbrew command used for?
perlbrew manages multiple Perl installations in user space. It enables switching between versions without system access. Installations compile Perl from source in ~/perl5/perlbrew. Each version is independent with its own modules and libraries. Libraries provide isolated module sets for the same Perl version. This enables project-specific dependencies without conflicts. Switch sets the default version for new shells. Use changes only the current shell. This flexibility supports development across versions. cpanm integration simplifies module installation. It's installed once and works with all managed Perl versions. Exec runs commands against specific versions, useful for testing compatibility or building packages.
How do I run a basic perlbrew example?
Run `perlbrew install perl-[5.38.0]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does install _VERSION_ do in perlbrew?
Install Perl version.