Use when writing or reviewing Perl 5.32+ code and unsure which feature is available in which version, or when porting legacy Perl idioms forward. Covers the version-gated feature table (5.32/5.36/5.38/5.40) and the legacy-to-modern anti-pattern mapping.
Scanned 9/19/2026
Install to Claude Code
npx -y skills add Mixard/fable-pack --skill perl-modern --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Perl Modern?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/mixard-perl-modern)More formats (shields.io, HTML) on the badges page.
---
name: perl-modern
description: Use when writing or reviewing Perl 5.32+ code and unsure which feature is available in which version, or when porting legacy Perl idioms forward. Covers the version-gated feature table (5.32/5.36/5.38/5.40) and the legacy-to-modern anti-pattern mapping.
---
# Modern Perl
## Version-gated features
| Feature | Since | Notes |
|---|---|---|
| `isa` infix operator | 5.32 | replaces `blessed($o) && $o->isa('X')` |
| `use v5.36` baseline | 5.36 | enables strict, warnings, signatures, `say` |
| `builtin 'true', 'false'` | 5.36 | experimental |
| `for_list` (multi-var for) | 5.36 | experimental in 5.36, stable in 5.40 |
| `class`/`field`/`method` (Corinna) | 5.38 | `use feature 'class'; no warnings 'experimental::class';` |
| native `try`/`catch` | 5.40 | stable; earlier versions use Try::Tiny |
## Legacy-to-modern conversion
| Legacy | Modern |
|---|---|
| `use strict; use warnings;` | `use v5.36;` |
| `my ($x, $y) = @_;` | `sub foo($x, $y) { ... }` |
| `@{ $ref }` / `%{ $ref }` | `$ref->@*` / `$ref->%*` |
| `open FH, "< $file"` | `open my $fh, '<:encoding(UTF-8)', $file` |
| blessed hashref | Moo class with types |
| `$1, $2, $3` | `$+{name}` named captures |
| `eval { }; if ($@)` | Try::Tiny or native try/catch (5.40+) |
| `BEGIN { require Exporter }` | `use Exporter 'import';` |
| manual file ops | Path::Tiny |
| `blessed($o) && $o->isa('X')` | `$o isa 'X'` (5.32+) |
## Gotcha
Deep reads autovivify every intermediate level: `my $x = $config->{cache}{host}` creates `$config->{cache} = {}` even though it returns `undef` (only the final key stays absent). Guard with `exists $config->{cache} && exists $config->{cache}{host}`, or add `no autovivification;` (CPAN pragma) in the lexical scope.
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!