mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-05-18 14:53:05 +08:00
Translate everything-claude-code repository to Japanese including: - 17 root documentation files - 60 agent documentation files - 80 command documentation files - 99 rule files across 18 language directories (common, angular, arkts, cpp, csharp, dart, fsharp, golang, java, kotlin, perl, php, python, ruby, rust, swift, typescript, web) - 199 skill documentation files Total: 455 files translated to Japanese with: - Consistent terminology glossary applied throughout - YAML field names preserved in English (name, description, etc.) - Code blocks and examples untouched (comments translated) - Markdown structure and relative links preserved - Professional translation maintaining technical accuracy This translation expands ECC accessibility to Japanese-speaking developers and teams. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
77 lines
1.7 KiB
Markdown
77 lines
1.7 KiB
Markdown
---
|
||
paths:
|
||
- "**/*.pl"
|
||
- "**/*.pm"
|
||
- "**/*.t"
|
||
- "**/*.psgi"
|
||
- "**/*.cgi"
|
||
---
|
||
# Perl パターン
|
||
|
||
> このファイルは [common/patterns.md](../common/patterns.md) を Perl 固有のコンテンツで拡張します。
|
||
|
||
## リポジトリパターン
|
||
|
||
**DBI** または **DBIx::Class** をインターフェースの背後に使用する:
|
||
|
||
```perl
|
||
package MyApp::Repo::User;
|
||
use Moo;
|
||
|
||
has dbh => (is => 'ro', required => 1);
|
||
|
||
sub find_by_id ($self, $id) {
|
||
my $sth = $self->dbh->prepare('SELECT * FROM users WHERE id = ?');
|
||
$sth->execute($id);
|
||
return $sth->fetchrow_hashref;
|
||
}
|
||
```
|
||
|
||
## DTO / 値オブジェクト
|
||
|
||
**Moo** クラスと **Types::Standard** を使用する(Python の dataclass に相当):
|
||
|
||
```perl
|
||
package MyApp::DTO::User;
|
||
use Moo;
|
||
use Types::Standard qw(Str Int);
|
||
|
||
has name => (is => 'ro', isa => Str, required => 1);
|
||
has email => (is => 'ro', isa => Str, required => 1);
|
||
has age => (is => 'ro', isa => Int);
|
||
```
|
||
|
||
## リソース管理
|
||
|
||
- 常に `autodie` 付きの **3引数 open** を使用する
|
||
- ファイル操作には **Path::Tiny** を使用する
|
||
|
||
```perl
|
||
use autodie;
|
||
use Path::Tiny;
|
||
|
||
my $content = path('config.json')->slurp_utf8;
|
||
```
|
||
|
||
## モジュールインターフェース
|
||
|
||
`Exporter 'import'` と `@EXPORT_OK` を使用する — `@EXPORT` は使用しない:
|
||
|
||
```perl
|
||
use Exporter 'import';
|
||
our @EXPORT_OK = qw(parse_config validate_input);
|
||
```
|
||
|
||
## 依存関係管理
|
||
|
||
再現可能なインストールのために **cpanfile** + **carton** を使用する:
|
||
|
||
```bash
|
||
carton install
|
||
carton exec prove -lr t/
|
||
```
|
||
|
||
## リファレンス
|
||
|
||
スキル: `perl-patterns` で包括的なモダン Perl のパターンとイディオムを参照してください。
|