Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
ぼくがPerlで開発を行う時に工夫していること
Search
ybrliiu
April 16, 2018
Programming
0
530
ぼくがPerlで開発を行う時に工夫していること
Gotanda.pm #17
ybrliiu
April 16, 2018
Tweet
Share
More Decks by ybrliiu
See All by ybrliiu
これまでと、これからのPerlコミュニティ
ybrliiu
0
140
AstroNvim を使おう!
ybrliiu
0
4.4k
Perlでも関数の型をチェックしたい
ybrliiu
0
3k
Perl5.32の新機能
ybrliiu
0
150
Vue.jsで作ったサイトをバニラJSで書き直す悲しいお話
ybrliiu
1
1.1k
Perlにおける動的なモジュールロードのメリットとデメリット
ybrliiu
0
830
黒魔術で独自定義のenum型制約を満たす値のリ ストを取得する話
ybrliiu
0
410
Perlにおけるクラスの実装パターン.pdf
ybrliiu
0
1.6k
Presentation.pdf
ybrliiu
0
260
Other Decks in Programming
See All in Programming
すべてのコンテキストを、 ユーザー価値に変える
applism118
2
970
0626 Findy Product Manager LT Night_高田スライド_speaker deck用
mana_takada
0
130
git worktree × Claude Code × MCP ~生成AI時代の並列開発フロー~
hisuzuya
1
510
WindowInsetsだってテストしたい
ryunen344
1
200
5つのアンチパターンから学ぶLT設計
narihara
1
130
Kotlin エンジニアへ送る:Swift 案件に参加させられる日に備えて~似てるけど色々違う Swift の仕様 / from Kotlin to Swift
lovee
1
260
DroidKnights 2025 - 다양한 스크롤 뷰에서의 영상 재생
gaeun5744
3
330
20250613-SSKMvol.15
diostray
0
100
datadog dash 2025 LLM observability for reliability and stability
ivry_presentationmaterials
0
270
“いい感じ“な定量評価を求めて - Four Keysとアウトカムの間の探求 -
nealle
0
200
生成AIコーディングとの向き合い方、AIと共創するという考え方 / How to deal with generative AI coding and the concept of co-creating with AI
seike460
PRO
1
340
Team topologies and the microservice architecture: a synergistic relationship
cer
PRO
0
1.1k
Featured
See All Featured
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
53
2.8k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
940
Gamification - CAS2011
davidbonilla
81
5.3k
Building an army of robots
kneath
306
45k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
181
53k
Making Projects Easy
brettharned
116
6.3k
Docker and Python
trallard
44
3.4k
Optimising Largest Contentful Paint
csswizardry
37
3.3k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
50k
What’s in a name? Adding method to the madness
productmarketing
PRO
23
3.5k
How to Ace a Technical Interview
jacobian
277
23k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
46
9.6k
Transcript
ぼくがPerlで開発を行うときに工 夫していること by liiu Gotanda.pm #17 1 / 12
自己紹介 liiu / @_ybrliiu MobileFactory 18新卒 (希少な)Perl使いです プログラミング / 歴史
/ (F|T)PS 学生時代にCGIゲーム運営してたりしていました 2 / 12
アジェンダ 僕が個人でPerlを使うときに工夫していることをいくつか お話します 引数の受け取り方 未定義値の扱い方 よく使うプラグマなどを一度に有効にする 3 / 12
引数の受け取り方 できるだけサブルーチンの最初の行で引数を明示 する shiftはなるべく使わない sub hoge { my ($foo, $bar,
$baz) = @_; ... } sub method { my ($self, $arg1) = shift; } 4 / 12
signatures使いたい experimental早く外れてほしい sub hoge($foo, $bar, $baz = 'default string') {
... } 5 / 12
未定義値の取り扱い 未定義値を返す可能性のある関数やメソッドには maybe_ 未定義値を持つ可能性のある変数にもmaybe_と いう接頭辞を必ずつけるようにしています MooseのMaybe型も活用 6 / 12
こんなのも作ってました https://github.com/ybrliiu/p5-Scalish 7 / 12
使用例 use Scalish qw( option ); subtest 'match' => sub
{ my $option = option 'something'; my $ret = $option->match( Some => sub { 200 }, None => sub { 404 }, ); is $ret, 200; my $none = option undef; my $ret2 = $none->match( Some => sub { 200 }, None => sub { 404 }, ); is $ret2, 404; }; 8 / 12
よく使うプラグマなどを一気に有 効にする package NewApp::Exporter { use strict; use warnings; use
utf8; use feature qw( :5.26 signatures ); sub import { $_->import for qw( strict warnings utf8 ); feature->import(qw[ :5.26 signatures ]); warnings->unimport('experimental::signatures'); } } 9 / 12
使用例 use Moose; use Mojo::Base; と同じようなことをしてい ます package NewApp::Service::DoSomething {
# enable strict, warnings, utf8, feature(':5.26'), and signatures # disenable warnings 'experimental::signatures'; use NewApp::Exporter; sub do_something($self) { ... } } 10 / 12
メリット たくさん記述したりスニペット登録の必要がな いので楽 DRY べんり!!! デメリット 初めて見る人にはぱっと見て何をしているか わからない 11 /
12
12 / 12