Skip to content
Back to skills

Perl Modern

ASecurity

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.

  • 2 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 19, 2026
ai-agentsgo

Security analysis

A100/100

Scanned September 19, 2026

npx -y skills add Mixard/fable-pack --skill perl-modern --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Perl Modern?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Perl Modern
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/mixard-perl-modern/badge)](https://www.skillsdirectory.com/skills/mixard-perl-modern)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
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.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.