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
Gotanda.pm #1
Search
Mihyaeru
June 11, 2014
Programming
190
1
Share
Gotanda.pm #1
Python使いから見たPerl @ Gotanda.pm #1
Mihyaeru
June 11, 2014
More Decks by Mihyaeru
See All by Mihyaeru
会計 freee バックエンドの今後 / freee backend api
mihyaeru21
8
26k
Railsで実装されている機能のマイクロサービスへの切り離し / split to microservices from rails
mihyaeru21
1
860
WebエンジニアのためのMySQLデータ構造基礎(再) / mysql data structure for web developer 2
mihyaeru21
0
320
WebエンジニアのためのMySQLデータ構造基礎 / mysql data structure for web developer
mihyaeru21
1
720
WebエンジニアのためのMySQL入門 / learning mysql for web developer
mihyaeru21
7
2.7k
入門ReactiveX / about ReactiveX
mihyaeru21
3
500
RxSwiftと愉快な仲間たち / RxSwift with Units
mihyaeru21
4
2.8k
RxSwiftでTwitterの ライブラリを作ってる話 / RxTwift
mihyaeru21
4
780
CrystalでTwitter botを作ってみた / Create a Twitter bot in Crystal
mihyaeru21
0
1.3k
Other Decks in Programming
See All in Programming
Swift Concurrency Type System
inamiy
1
570
Lightning-Fast Method Calls with Ruby 4.1 ZJIT / RubyKaigi 2026
k0kubun
3
2.1k
The Less-Told Story of Socket Timeouts
coe401_
3
910
GoogleCloudとterraform完全に理解した
terisuke
1
180
WebAssembly を読み込むベストプラクティス 2026年春版 / Best Practices for Loading WebAssembly (Spring 2026)
petamoriken
5
1k
PicoRuby for IoT: Connecting to the Cloud with MQTT
yuuu
2
720
HTML-Aware ERB: The Path to Reactive Rendering @ RubyKaigi 2026, Hakodate, Japan
marcoroth
0
590
個人的に嬉しかったpnpmの新機能・3選
matsuo_atsushi
0
120
決定論 vs 確率論:Gemini 3 FlashとTF-IDFを組み合わせた「法規判定エンジン」の構築
shukob
0
140
第3木曜LT会 #28
tinykitten
PRO
0
120
🦞OpenClaw works with AWS
licux
1
320
検索設計から 推論設計への重心移動と Recall-First Retrieval
po3rin
5
1.4k
Featured
See All Featured
How to Talk to Developers About Accessibility
jct
2
190
From π to Pie charts
rasagy
0
180
The Pragmatic Product Professional
lauravandoore
37
7.2k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
130
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
100
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
130
Prompt Engineering for Job Search
mfonobong
0
290
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.9k
Transcript
1ZUIPO͍͔Βݟͨ1FSM (PUBOEBQN !NJIZBFSV
ࣗݾհ w ϛώϟΤϧ!NJIZBFSV w 1ZUIPO 0CKFDUJWF$ śƂŠƃٙ 1FSM w
ΏͱΓ7JNNFS w ζϰΟζμʔઓಆһ
Α͘--ͬͯҰׅΓʹ͞ΕΔ͠ 1ZUIPOΘ͔Ε༨༟Ͱ͠ΐ
ͭ1FSM
sub say_hello { my $name = shift; ! print "Hello,
$name\n"; }
͋ΕͬʁҾʁ TIJGUͬͯͳΜͶΜ
sub sum_numbers { my $sum; for (@_) { $sum +=
$_; } ! return $sum; }
Μͬʁ
$_ @_
@_ͱ͔$_ͱ͔Ͳ͔͜ΒདྷͨΜ ͳΜ͡Ό͍͜ΓΌʔʂ
࠷ॳʹࢥͬͨෆຬ w มͳه߸ଟͯ͘ҙຯෆ໌ w ίϯςΩετʁʁʁ w ຖճNZͬͯॻ͘ͷ໘͍͘͞ w ਅِΣʜʜ w
ϦϑΝϨϯεपΓ͕Θ͔Γʹ͍͘ w ҾϦετͲ͜ʂʁ ʜଞʹ͔͚͋ͬͨͩͲΕͨ͆
มͳه߸ଟͯ͘ҙຯෆ໌ $_ @_ 1ZUIPOͰ͜ΜͳʹढจΊ͍ͨมग़ͯ͜ͳ͔ͬͨʂ $! $@ ͨͿΜʜ $. $/
͜Μ͖ͯ͢ͱʁʁʁ @a = (0, 1, 2) Ϧετ ίϯςΩετ 0, 1,
2 εΧϥʔ ίϯςΩετ 3 ཁૉ͕Γ͔ͨͬͨΒlen()ͱ͔໌ࣔతʹॻ͖͍ͨ ॴʹΑͬͯҙຯ͢Δͱ͜Ζ͕ҧ͏ʜʜͩͱʜʜ
NZࢯ w --ͬͯݴΘΕΔ͘Β͍ͩ͠ɺϥΠτʹॻ͖͍ͨ w 1ZUIPOͰम০ࢠͳ͠ͰϩʔΧϧม
ਅِΣʜʜ w ਅِΛද͢໌֬ͳ͕ͭͳ͍ w 5SVF 'BMTFཉ͍ͬ͢͠ w ίϯςΩετ૬·ͬͯѻ͍͕͍͠
ϦϑΝϨϯε w ࠷ॳɺ ͱ<>ಉͩ͡ͱࢥ͍ͬͯͨ w εΧϥʔมͳͷʹྻʂ w 1ZUIPOͰྻͱݴͬͨΒ͜Ε͚ͩ @a =
(0, 1, 2); $ref = \@a; $ref = [0, 1, 2]; a = [0, 1, 2]
ͳΜͰҾϦετͳ͍ͷ w !@Λड͚ͱΔ͚Ͳ͍ํࣗ༝͗͢ w 1ZUIPOͩͱؔͷσϑΥϧτΛઃఆͰ͖Δ͠ ΩʔϫʔυͰݺͿ͜ͱग़དྷΔʂ my ($a, $b) =
@_; my $a = shift; my %args = @_;
ͪͳΈʹ w σϑΥϧτΛͬͨݺͼग़͠ w ී௨ͷݺͼग़͠ w Ωʔϫʔυݺͼग़͠ def hello(name =
'mihyaeru'): print 'Hello, %s' % name ! hello() hello('dareka') hello(name = 'anata')
ෆຬΛ๊͖ͭͭ ϲ݄͕ܦա
࠷ॳʹࢥͬͨෆຬ w มͳه߸ଟͯ͘ҙຯෆ໌ w ίϯςΩετʁʁʁ w ຖճNZͬͯॻ͘ͷ໘͍͘͞ w ਅِΣʜʜ w
ϦϑΝϨϯεपΓ͕Θ͔Γʹ͍͘ w ҾϦετͲ͜ʂʁ
࠷ॳʹࢥͬͨෆຬࠓ w มͳه߸ଟͯ͘ҙຯෆ໌ w ίϯςΩετʁʁʁ w ຖճNZͬͯॻ͘ͷ໘͍͘͞ w ਅِΣʜʜ w
ϦϑΝϨϯεपΓ͕Θ͔Γʹ͍͘ w ҾϦετͲ͜ʂʁ ׳ΕΕා͘ͳ͍ʂ ׳ΕΕʢ͈́ ॻ͍ͨํ͕҆৺ײ͋Δ ਅِΣʜʜ Ҿʹ໊લͳ͘୯ͳΔϦετ ະͩʹͬ͘͠Γ͜ͳ͍
ෆຬ͔Γݴͬͯ ΞϨͳͷͰ
ؾʹೖ͍ͬͯΔͱ͜Ζ w ແ໊͕͍͍ؔ͢ w NBQͱ͔HSFQͷײ͕͖͡ w ϝιουݺͼग़࣌͠ͷୈҰҾʹTFMG͕ೖͬͯ͘Δ
ແ໊͕͍͍ؔ͢ w 1ZUIPOʹMBNCEBͱ͍͏ແ໊ؔΛ࡞Δه๏ΞϦ w ࣜΛ͔ͭ͠ೖΕΒΕͳ͍͔Βจͷॲཧμϝ hoge_call(sub { # do #
something # hoge }); def temp(): # do # something # hoge ! hoge_call(temp) 1FSM 1ZUIPO
NBQͱ͔HSFQ͕ྑ͍ײ͡ ҾΛح͚ͩʹߜΓࠐΜͰɺɺɺ ͨ͠ͷྻʹ͢Δɺɺɺ తͳॲཧ my @squared_odds = map { $_
* $_ } grep { $_ % 2 == 1 } @_;
1ZUIPOͩͱ [x * x for x in nums if x
% 2 == 1]
1ZUIPOͩͱ [x * x for x in nums if x
% 2 == 1] NBQʹ૬ HSFQʹ૬
Ϧετแදه [x * x for x in X if x
% 2 == 1] {x2 | x ∈ X, x % 2 = 1} ֶͷू߹ʹ͓͚Δแతදه͕ݩʹͳ͍ͬͯΔ
ϝιουͷTFMG 1ZUIPOΛኲኵͱͤͯۙ͞ײ͋Γ sub method { my ($self, $hoge) = @_;
} def method(self, hoge): pass
ಥ͚ͩͲ ͦΜͳ͜ΜͳͰ
·ͱΊ w 1FSM͍࢝Ίͯϲ݄ͷਓͷײ w ֖Λ͚͋ͯΈΔͱṖ͍ͱ͜Ζ͕ଟʑ w ͋Δఔ׳ΕͰͳΜͱ͔ͳΔʂ w 1FSMා͔͚ͬͨͲࠓͰ͖ͳͱ͜Ζ͋Δʂʂ