Built on affaan-m/ECC by @affaan-m (260,309 stars, MIT). All credit for the original idea to them. This fork improves and repackages it; upstream license preserved in UPSTREAM_LICENSE.
A Claude Code skill for writing safe, clear, and easy-to-test modern Perl 5.36+ code.
Old Perl code can be hard to read and risky to change.
Modern Perl has safer forms for args, objects, data, and errors. Yet each app may use a different Perl version or set of modules.
This skill helps Claude check those limits first. It then gives clear patterns that fit your app.
It is for people who write, review, fix, or update Perl code. It also plugs into your current Claude Code flow.
Run one command:
mkdir -p ~/.claude/skills/perl-patterns && curl -fsSL https://raw.githubusercontent.com/modern-perl-patterns-plus/modern-perl-patterns-plus/main/skill/SKILL.md -o ~/.claude/skills/perl-patterns/SKILL.mdThe skill is one file. It has no setup step of its own.
Ask Claude Code to review or write Perl with the skill:
Use the perl-patterns skill to update this sub for Perl 5.36.
Keep its public API the same. Explain any risk before you edit it.
sub label {
my ($text) = @_;
$text = 'none' unless defined $text;
return $text;
}
Expected output:
use v5.36;
sub label($text = undef) {
$text //= 'none';
return $text;
}Claude should first check the app's Perl version, tests, modules, public API, and deploy needs. It should explain that a signature default is used only when an arg is missing. The //= line also handles an explicit undef.
- Rewrote the main notes from Japanese into plain, short English.
- Added clear copyright credit for ECC.
- Added checks to run before a change. These cover the target Perl version, current modules, tests, public APIs, and deploy needs.
- Added clear notes about
undef, signature defaults, named args, context-based APIs, and type checks. - In the improved version described for this fork, the old sections on error handling,
Try::Tiny, Perl 5.40tryandcatch, and object code with Moo were removed.
This project is available under the MIT License.
The upstream MIT license and copyright notice are preserved in UPSTREAM_LICENSE.
