SKILL

perl-patterns

现代 Perl 5.36+ 的惯用法、最佳实践与约定,用于构建健壮、可维护的 Perl 应用。在编写或审查现代 Perl 5.36+ 代码时使用。

机器翻译
查看英文原文

Modern Perl 5.36+ idioms, best practices, and conventions for building robust, maintainable Perl applications. Use when writing or reviewing modern Perl 5.36+ code.

适用对象:软件开发与测试。自动收录 · 待核查。

原作者说明节选

从固定版本的 SKILL.md 提取,保留原文语言。以下内容属于作者说明,本站尚未验证安装、兼容或运行结果。

查看英文原文

原文涵盖的主题

  • Modern Perl Development Patterns
  • When to Activate
  • How It Works
  • Core Principles
  • 1. Use v5.36 Pragma
  • 2. Subroutine Signatures
  • 3. Context Sensitivity
  • 4. Postfix Dereferencing

Idiomatic Perl 5.36+ patterns and best practices for building robust, maintainable applications. Writing new Perl code or modules Reviewing Perl code for idiom compliance Refactoring legacy Perl to modern standards Designing Perl module architecture Migrating pre-5.36 code to modern Perl Apply these patterns as a bias toward modern Perl 5.36+ defaults: signatures, explicit modules, focused error handling, and testable boundaries. The examples below are meant to be copied as starting points, then tightened for the actual app, dependency stack, and deployment model in front of you. A single use v5.36 replaces the old boilerplate and enables strict, warnings, and subroutine signatures. Use signatures for clarity and automatic arity checking. Understand scalar vs list context — a core Perl concept. Use postfix dereference syntax for readability with nested structures. Infix type-check — replaces blessed($o) && $o->isa('X'). Prefer Moo for lightweight, modern OO. Use Moose only when its metaprotocol is needed. | Legacy Pattern | Modern Replacement | |---|---| | use strict; use warnings; | use v5.36; | | my ($x, $y) = @; | sub foo($x, $y) { ... } | | @{ $ref } | $ref->@ | | %{ $ref } | $

这里只展示节选,请以完整原文和当前要求为准。

来源仓库
affaan-m/ECC
源文件
pi/core/skills/perl-patterns/SKILL.md
固定版本
d2ef2680594f9a17526a6e1a2e18b3d242c5d17b
阅读完整原作者说明 ↗

来源与内容状态

本条为自动发现的元数据,尚未完成人工文档核查;适用性与运行结果待核查。

原作者:affaan-m/ECC · 原作者仓库元数据。文档核查:未核查。最近来源检查:2026-11-09T15:01:43.165Z。

分类由名称、说明与路径规则生成,分类不代表已核实适配。

许可与权利归属

MIT。第三方内容及版权归原作者,使用条件以原文为准。

许可原文 ↗

本站没有因同步、复制或用户自报成功而将资源标为运行验证通过。

限制与注意事项

  • 元数据收录不代表本站已经安装、适配、实测或进行安全审查。