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
570
ぼくがPerlで開発を行う時に工夫していること
Gotanda.pm #17
ybrliiu
April 16, 2018
Tweet
Share
More Decks by ybrliiu
See All by ybrliiu
これまでと、これからのPerlコミュニティ
ybrliiu
0
170
AstroNvim を使おう!
ybrliiu
0
5.2k
Perlでも関数の型をチェックしたい
ybrliiu
0
3.6k
Perl5.32の新機能
ybrliiu
0
180
Vue.jsで作ったサイトをバニラJSで書き直す悲しいお話
ybrliiu
1
1.1k
Perlにおける動的なモジュールロードのメリットとデメリット
ybrliiu
0
890
黒魔術で独自定義のenum型制約を満たす値のリ ストを取得する話
ybrliiu
0
440
Perlにおけるクラスの実装パターン.pdf
ybrliiu
0
1.7k
Presentation.pdf
ybrliiu
0
290
Other Decks in Programming
See All in Programming
API Platformを活用したPHPによる本格的なWeb API開発 / api-platform-book-intro
ttskch
1
130
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
270
株式会社 Sun terras カンパニーデック
sunterras
0
2.1k
エンジニアの「手元の自動化」を加速するn8n 2026.02.27
symy2co
0
140
AIコードレビューの導入・運用と AI駆動開発における「AI4QA」の取り組みについて
hagevvashi
0
440
Railsの気持ちを考えながらコントローラとビューを整頓する/tidying-rails-controllers-and-views-as-rails-think
moro
5
390
Fundamentals of Software Engineering In the Age of AI
therealdanvega
1
250
「抽象に依存せよ」が分からなかった新卒1年目の私が Goのインターフェースと和解するまで
kurogenki
0
110
Angular-Apps smarter machen mit Gen AI: Lokal und offlinefähig - Hands-on Workshop!
christianliebel
PRO
0
110
Claude Code Skill入門
mayahoney
0
310
今更考える「単一責任原則」 / Thinking about the Single Responsibility Principle
tooppoo
3
1.6k
社内規程RAGの精度を73.3% → 100%に改善した話
oharu121
13
8k
Featured
See All Featured
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.6k
The Cost Of JavaScript in 2023
addyosmani
55
9.8k
Documentation Writing (for coders)
carmenintech
77
5.3k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
340
Context Engineering - Making Every Token Count
addyosmani
9
740
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
300
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
230
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
A Modern Web Designer's Workflow
chriscoyier
698
190k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.2k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
540
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