App-karr
view release on metacpan or search on metacpan
.claude/skills/perl-core/SKILL.md view on Meta::CPAN
- **`my ( $self ) = @_;`** â explicit destructure, not `my $self = shift;`. Space inside the parens.
- **Explicit import lists with `qw( ... )`** â `use Foo qw( bar baz );`. Never rely on default exports unless they're documented as stable.
### Methods, not bare subs
- **In a Moose class, every helper is a method on `$self`.** Not a bare `sub _foo { ... }` invoked as `_foo($self->goldmine, $x)`. The class is there; use it.
- **Per-process caches go on the singleton as a Moose attribute** (`has _cache => ( is => 'ro', default => sub { {} } )`), not a `my %CACHE` package variable. Survives test isolation, lets a future caller swap state per instance.
- **No package-level state** unless it's a true global (an `%ENGINE_CLASS` lookup table that's literally constant counts; a per-call cache does not).
- Bare subs are OK in **non-class utility modules** that are imported as functions (`Goldmine::I18n::gm_key`, `Goldmine::BlockerReason::blocker`). Once a file says `use Moose` / `use MooseX::Singleton`, every `sub` should be a method.
Why: bare subs hide what the call needs (`$gm` passed manually each time), can't be overridden in a subclass, can't be mocked in tests, and force every caller to thread state by hand. `$self->method` is one extra colon-pair and gives all four for fre...
## Style / whitespace
- **2-space indentation.** Not 4. Not tabs. Every Getty Perl file.
- **No trailing commas** at the end of multi-line lists (different from Python convention).
## File I/O
- **`Path::Tiny`** for every file operation. Not `File::Spec`, not bare `open`. Method-chain: `path(...)->child(...)->slurp_utf8`.
( run in 0.766 second using v1.01-cache-2.11-cpan-c966e8aa7e8 )