Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
ぼくがPerlで開発を行う時に工夫していること
Search
ybrliiu
April 16, 2018
Programming
590
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
ぼくがPerlで開発を行う時に工夫していること
Gotanda.pm #17
ybrliiu
April 16, 2018
More Decks by ybrliiu
See All by ybrliiu
これまでと、これからのPerlコミュニティ
ybrliiu
0
180
AstroNvim を使おう!
ybrliiu
0
5.5k
Perlでも関数の型をチェックしたい
ybrliiu
0
3.8k
Perl5.32の新機能
ybrliiu
0
200
Vue.jsで作ったサイトをバニラJSで書き直す悲しいお話
ybrliiu
1
1.2k
Perlにおける動的なモジュールロードのメリットとデメリット
ybrliiu
0
940
黒魔術で独自定義のenum型制約を満たす値のリ ストを取得する話
ybrliiu
0
470
Perlにおけるクラスの実装パターン.pdf
ybrliiu
0
1.8k
Presentation.pdf
ybrliiu
0
310
Other Decks in Programming
See All in Programming
マイコン向けの軽量Ruby「PicoRuby」で各種デバイスを制御するネイティブアプリの実現手法
bash0c7
0
470
巨大モノリシックアプリ モダン化大作戦
ktcryomm
1
1.2k
Simple Storage Service(S3) is not simple
iwatsukayura
0
120
Embedded Swiftで作る自作USBデバイス によるiOSデバイスの自動テスト / iOSDC Japan 2026 glassfiber
glassfiber
0
260
iOSDC2026登壇資料.pdf
riofujimon
0
200
Vue Fes Japan 2026 タイムテーブル徹底解説
448jp
1
590
Agentic Software Factoryに、すごく賢いIF文を。 / super smart IF statement into the Agentic Software Factory.
rkaga
0
320
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
410
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Rails World 2026, Austin, Texas
marcoroth
0
150
選挙速報を多くのユーザーへ 届ける Live Activities 設計
hamayokokuririn
0
210
モジュールの視点からSwiftを読み解く #iosdc
s_shimotori
0
300
半永久的に提供し続けられるプライベートクラウドを目指して ― 利用者の認知負荷を抑えるAPI抽象化とハードウェア世代交代の基盤設計
tomokon
0
390
Featured
See All Featured
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.7k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
600
Navigating Weather and Climate Data
rabernat
0
540
So, you think you're a good person
axbom
PRO
2
2.2k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
530
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
510
Writing Fast Ruby
sferik
630
63k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Typedesign – Prime Four
hannesfritz
42
3.2k
GitHub's CSS Performance
jonrohan
1033
470k
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