跳到正文
cccskills
免费在 GitHub 公开

perl-environment-setup

This skill should be used when the user asks to "install perlbrew", "set up Perl environment", "install Perl version", "manage Perl versions", "switch Perl version", "install plenv", or mentions Perl version management, development environment setup, or multiple Perl installations.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(1)

  • SKILL.md6.7 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Perl Environment Setup

Guide for setting up Perl development environments using perlbrew for version management.

perlbrew Overview

perlbrew manages multiple Perl installations in user space without root access.

Benefits

  • Install any Perl version without root
  • Switch between versions instantly
  • Isolated module installations per version
  • Test against multiple Perl versions

Installation

Quick Install

# Download and run installer
curl -L https://install.perlbrew.pl | bash

# Initialize perlbrew
perlbrew init

# Add to shell profile (~/.bashrc or ~/.zshrc)
source ~/perl5/perlbrew/etc/bashrc

Verify Installation

perlbrew version
perlbrew list
which perl

Installing Perl Versions

List Available Versions

# Show all available versions
perlbrew available

# Show only stable releases
perlbrew available | grep -E '^\s*perl-5\.\d+\.\d+$'

Install a Version

# Install latest stable
perlbrew install perl-5.38.2

# Install with threading
perlbrew install perl-5.38.2 -Dusethreads

# Install with optimizations
perlbrew install perl-5.38.2 -Doptimize=-O2

# Quick install (skip tests)
perlbrew install perl-5.38.2 --notest

# Install with custom name
perlbrew install perl-5.38.2 --as perl-5.38-dev

Common Build Options

OptionPurpose
-DusethreadsEnable thread support
-DuseithreadsEnable interpreter threads
--notestSkip test suite (faster)
-j NParallel build with N jobs
--as NAMECustom installation name

Switching Versions

# Switch for current shell
perlbrew use perl-5.38.2

# Set permanent default
perlbrew switch perl-5.38.2

# Temporary switch with command
perlbrew exec --with perl-5.38.2 perl -v

# Return to system Perl
perlbrew switch-off
perlbrew off  # Shortcut

Managing Installations

# List installed versions
perlbrew list

# Show current version
perlbrew info

# Remove a version
perlbrew uninstall perl-5.36.0

# Upgrade perlbrew itself
perlbrew self-upgrade

Library Management

perlbrew lib creates isolated module environments per Perl version.

Create Libraries

# Create a library for a project
perlbrew lib create perl-5.38.2@myproject

# List libraries
perlbrew lib list

# Switch to library
perlbrew use perl-5.38.2@myproject

# Delete library
perlbrew lib delete perl-5.38.2@myproject

Per-Project Libraries

# Create project-specific environment
perlbrew lib create perl-5.38.2@webapp

# Install modules to this library
perlbrew use perl-5.38.2@webapp
cpanm Mojolicious DBIx::Class

# Switch between project environments
perlbrew use perl-5.38.2@webapp
perlbrew use perl-5.38.2@cli-tools

cpanm Integration

# Install cpanm for current Perl
perlbrew install-cpanm

# Now cpanm is available
cpanm Module::Name

Testing Across Versions

# Run command with all installed Perls
perlbrew exec perl -v

# Run tests with all versions
perlbrew exec prove -l t/

# Run with specific versions
perlbrew exec --with perl-5.36.0,perl-5.38.2 prove t/

Shell Integration

Bash/Zsh

Add to ~/.bashrc or ~/.zshrc:

source ~/perl5/perlbrew/etc/bashrc

Fish

Add to ~/.config/fish/config.fish:

source ~/perl5/perlbrew/etc/perlbrew.fish

Project Configuration

.perl-version File

Create a .perl-version file in project root (for tools that support it):

5.38.2

Project Setup Script

#!/bin/bash
# setup-perl-env.sh

PERL_VERSION="perl-5.38.2"
PROJECT_LIB="myproject"

# Ensure perlbrew is loaded
source ~/perl5/perlbrew/etc/bashrc

# Install Perl if needed
if ! perlbrew list | grep -q "$PERL_VERSION"; then
    perlbrew install "$PERL_VERSION" --notest
fi

# Create project library if needed
if ! perlbrew lib list | grep -q "$PROJECT_LIB"; then
    perlbrew lib create "${PERL_VERSION}@${PROJECT_LIB}"
fi

# Switch to project environment
perlbrew use "${PERL_VERSION}@${PROJECT_LIB}"

# Install cpanm if needed
command -v cpanm >/dev/null || perlbrew install-cpanm

# Install project dependencies
cpanm --installdeps .

echo "Environment ready: $(perl -v | grep version)"

Directory Structure

perlbrew creates this structure:

~/perl5/perlbrew/
├── bin/           # perlbrew executable
├── build/         # Temporary build files
├── dists/         # Downloaded Perl sources
├── etc/           # Shell integration scripts
└── perls/         # Installed Perl versions
    ├── perl-5.36.0/
    └── perl-5.38.2/

Troubleshooting

Build Failures

# Check build log
less ~/perl5/perlbrew/build.perl-5.38.2.log

# Install build dependencies
# Debian/Ubuntu
sudo apt install build-essential

# Install with verbose output
perlbrew --verbose install perl-5.38.2

Path Issues

# Verify perlbrew is loaded
which perl
# Should show ~/perl5/perlbrew/perls/...

# Check current environment
perlbrew info

# Force reload
source ~/perl5/perlbrew/etc/bashrc

Cleanup

# Remove build artifacts
perlbrew clean

# Remove downloaded source archives
rm -rf ~/perl5/perlbrew/dists/*

Recommended Setup

For new development machines:

# 1. Install perlbrew
curl -L https://install.perlbrew.pl | bash
source ~/perl5/perlbrew/etc/bashrc

# 2. Install latest stable Perl
perlbrew install perl-5.38.2 --notest
perlbrew switch perl-5.38.2

# 3. Install cpanm
perlbrew install-cpanm

# 4. Install essential modules
cpanm App::cpanoutdated
cpanm Perl::Critic
cpanm Perl::Tidy

# 5. Add to shell profile
echo 'source ~/perl5/perlbrew/etc/bashrc' >> ~/.bashrc

Alternative: plenv

plenv is an alternative to perlbrew inspired by rbenv:

# Install plenv
git clone https://github.com/tokuhirom/plenv.git ~/.plenv
git clone https://github.com/tokuhirom/Perl-Build.git ~/.plenv/plugins/perl-build/

# Add to PATH
echo 'export PATH="$HOME/.plenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(plenv init -)"' >> ~/.bashrc

# Install Perl
plenv install 5.38.2
plenv global 5.38.2
plenv install-cpanm

plenv advantages:

  • Simpler architecture (shims-based)
  • Faster shell startup
  • Per-directory version files (.perl-version)

perlbrew advantages:

  • More mature and widely used
  • Better library management
  • More configuration options

Additional Resources

For CPAN module management, see the perl-cpan-ecosystem skill.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Add automated documentation updater to any Claude skill. Creates a Python sync script that downloads upstream docs, processes markdown for AI consumption, and maintains local cache with configurable refresh. Collects template variables, then delegates implementation through 5-phase workflow. Use when adding auto-updating reference documentation to plugins or skills.

中文简介正在准备中。当前显示原文说明。

Jamie-BitFlight/claude_skills672026年10月20日 更新

SAM-style feature initiation workflow — discovery through codebase analysis, architecture spec, task decomposition, validation, and context manifest. Use when a user asks to add a feature, plan a feature, or convert an idea into an executable SAM plan.

中文简介正在准备中。当前显示原文说明。

Jamie-BitFlight/claude_skills672026年10月20日 更新

Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction.

中文简介正在准备中。当前显示原文说明。

Jamie-BitFlight/claude_skills672026年10月20日 更新

Browser automation for AI agents using the agent-browser CLI and Playwright. Use when navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, logging into sites, or automating any browser task. Triggers on "open a website", "fill out a form", "click a button", "scrape data", "test this web app", "automate browser actions", or any programmatic web interaction request.

中文简介正在准备中。当前显示原文说明。

Jamie-BitFlight/claude_skills672026年10月20日 更新

Runs the description-drift experiment — spawns all Claude Code agents simultaneously to collect self-reported capabilities, then compares them against static frontmatter descriptions to reveal how reliable orchestrator routing based on descriptions actually is. Use when measuring description drift across the agent fleet, re-running the capability collection experiment, analyzing a specific agent's self-reported capabilities, or auditing whether frontmatter descriptions accurately reflect agent behavior.

中文简介正在准备中。当前显示原文说明。

Jamie-BitFlight/claude_skills672026年10月20日 更新

Create or adapt Claude Code agent definitions. Use when creating an agent, changing subagent configuration, selecting agent scope, or designing a specialized delegation role.

中文简介正在准备中。当前显示原文说明。

Jamie-BitFlight/claude_skills672026年10月20日 更新

查看 Jamie-BitFlight 的全部技能

报告此技能的问题