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調査団 Part1
Search
AnaTofuZ
March 17, 2018
Technology
0
1k
ドキドキPerl調査団 Part1
Okinawa.pm #6の発表資料です
AnaTofuZ
March 17, 2018
Tweet
Share
More Decks by AnaTofuZ
See All by AnaTofuZ
令和最新版 Perlコーディングガイド
anatofuz
5
5.6k
rakulangで実装する! RubyVM
anatofuz
6
2.6k
沖縄の大学で育った学生がエンジニアになるまで
anatofuz
2
5.4k
OpenAPI Generator Perl Clientでも型チューニングしたい!!
anatofuz
0
320
perlimportsから探るPPIの世界
anatofuz
0
3.8k
GraphQLスキーマの設計で考えたこと
anatofuz
1
1.5k
インターネットアイドル目指して
anatofuz
1
200
How to build traditional Perl interpreters.
anatofuz
0
850
レガシーPython散策
anatofuz
2
1.9k
Other Decks in Technology
See All in Technology
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
6
57k
エンジニアの育成を支える爆速フィードバック文化
sansantech
PRO
3
1.1k
ホワイトボードチャレンジ 説明&実行資料
ichimichi
0
130
レビューを増やしつつ 高評価維持するテクニック
tsuzuki817
1
720
分解して理解する Aspire
nenonaninu
1
140
(機械学習システムでも) SLO から始める信頼性構築 - ゆる SRE#9 2025/02/21
daigo0927
0
120
人はなぜISUCONに夢中になるのか
kakehashi
PRO
6
1.7k
『衛星データ利用の方々にとって近いようで触れる機会のなさそうな小話 ~ 衛星搭載ソフトウェアと衛星運用ソフトウェア (実物) を動かしながらわいわいする編 ~』 @日本衛星データコミニティ勉強会
meltingrabbit
0
150
JEDAI Meetup! Databricks AI/BI概要
databricksjapan
0
100
Larkご案内資料
customercloud
PRO
0
650
利用終了したドメイン名の最強終活〜観測環境を育てて、分析・供養している件〜 / The Ultimate End-of-Life Preparation for Discontinued Domain Names
nttcom
2
200
スタートアップ1人目QAエンジニアが QAチームを立ち上げ、“個”からチーム、 そして“組織”に成長するまで / How to set up QA team at reiwatravel
mii3king
2
1.5k
Featured
See All Featured
Gamification - CAS2011
davidbonilla
80
5.1k
How to Ace a Technical Interview
jacobian
276
23k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2.1k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Bootstrapping a Software Product
garrettdimon
PRO
306
110k
A Philosophy of Restraint
colly
203
16k
Side Projects
sachag
452
42k
Making the Leap to Tech Lead
cromwellryan
133
9.1k
Site-Speed That Sticks
csswizardry
4
380
Building Adaptive Systems
keathley
40
2.4k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
4
410
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
114
50k
Transcript
υΩυΩPerlௐࠪஂ Part1 @AnaTofuZ Okinawa.pm #6
None
Θͨ͠ Ͱ͢
• Ξφάϥ(@AnaTofuZ) • ླྀେ@ฒྻ৴པݚ(u͞Μͷޙഐ) • Perl͕͖ɹʢόΠτઌRuby) • झຯΫιϦϓ ΞφάϥͰ͢
͋Δ
;ͱࢥ͏
Perl1.0 ࣮ࡏ ͨ͠ͷ͔
Α͘Θ͔ΔPerl • Perl1.0 —ɹ͋ͬͨΒ͍͠ • Perl2 - Տઌੜ͕ॳΊͯPerlͱग़ձͬͨ࣌ • Perl3
ҧ͍͕͔ΒΜ • Perl4 Տઌੜ͕ຊΛग़ͨ͠ • Perl5 զʑͷͬͯΔPerl
Α͘Θ͔ΔPerl • Perl1.0 —ɹ͋ͬͨΒ͍͠ • Perl2 - Տઌੜ͕ॳΊͯPerlͱग़ձͬͨ࣌ • Perl3
ҧ͍͕͔ΒΜ • Perl4 Տઌੜ͕ຊΛग़ͨ͠ • Perl5 զʑͷͬͯΔPerl Perl1
Α͘Θ͔ΔPerl • Perl1.0 —ɹ͋ͬͨΒ͍͠ • Perl2 - Տઌੜ͕ॳΊͯPerlͱग़ձͬͨ࣌ • Perl3
ҧ͍͕͔ΒΜ • Perl4 ͋ͬͨΒ͍͠ • Perl5 զʑͷͬͯΔPerl ਆ
Perl 1.0 [ݕࡧ]
https://bitbucket.org/chastai/perl-1.0
None
ࠓͰ ಈ࡞
Perl5ͷσʔλܕ • εΧϥʔ • ྻ • ϋογϡ • ϦϑΝϨϯε
Perl1ͷσʔλܕ • εΧϥʔ • ྻ • ϋογϡ • ϦϑΝϨϯε
Perl1ͷσʔλܕ • εΧϥʔ • ྻ • ϋογϡ • ϦϑΝϨϯε
Perl1ͷσʔλܕ • εΧϥʔ • ྻ + ࿈ྻ
Perl1ͷσʔλܕ • εΧϥʔ • ྻ + ࿈ྻ
Perl1ͷσʔλܕ • String • Stringྻ + ࿈ྻ
Perl1Ͱͳ͍ͷ • ൣғԋࢉࢠ • foreach (ग़དྷͳ͘ͳ͍) • ଞϞδϡʔϧ • use
• my,our,local…
Perl1Ͱ͋Δͷ • ஔ • ਖ਼نදݱ • Ϧετૢ࡞ (shift,unsift,pop,push) • @_
• จࣈྻԋࢉࢠ • chop • each
αϒϧʔνϯ͋Δͧ!! sub MAX { $max = pop(@_); while ($foo =
pop(@_)) { $max = $foo if $max < $foo; } $max; } ... $bestday = do MAX($mon,$tue,$wed,$thu,$fri);
for loopग़དྷΔͧ!! #!/usr/bin/env perl @array = (1,2,3,4,5,6,7,8,9,10); for ( $i
= 0; $i < 10; $i++){ print $array[$i] ."\n"; }
for loop (ޭ) #!/usr/bin/env perl @array = (1,2,3,4,5,6,7,8,9,10); for (
$i = 0; $i < 10; $i++){ print $array["$i"] ."\n"; }
ऑ • Ͳ͏γϯϘϧςʔϒϧʹΞΫηεͰ͖ͳ͍ • αϒϧʔνϯʹྻΛͤͳ͍ (ग़དྷͳ͘ͳ͍) • ίϯύΠϧΤϥʔͷϝοηʔδ͕ແͯ͘ݫ͠ ͍
օ͞Μ ॻ͍ͯΈͨ͘ͳΓ·ͤΜ͔?
None
None
array_pop_shift.pl #!/usr/bin/env perl @names = ('Alice','Bob','Chris'); print pop @names .
"\n"; print shift @names . "\n";
array_push_unshift.pl #!/usr/bin/env perl @names = ('Alice','Bob','Chris'); push(@names,"Diana"); unshift(@names,"Eve"); for ($i
= 0; $i < $#names+1; $i++){ print $names["$i"]."\n"; }
None
ͦΕͬΆ͘ #!/usr/bin/env perl $my_profile['name'] = 'AnaTofuZ'; $my_profile['age'] = 21; $my_profile['food']
= 'apple'; print $my_profile["name"] . "\n"; print $my_profile["age"] . "\n"; print $my_profile["food"] . "\n";
!? apple apple apple
ਖ਼ղྫ #!/usr/bin/env perl $my_profile{'name'} = 'AnaTofuZ'; $my_profile{'age'} = 21; $my_profile{'food'}
= 'apple'; print $my_profile{"name"} . "\n"; print $my_profile{"age"} . "\n"; print $my_profile{"food"} . "\n";
͜Εok #!/usr/bin/env perl ($my_profile{'name'},$my_profile{'age'}, $my_profile{'food'}) = ( 'AnaTofuZ',21,'apple'); print $my_profile{"name"}
. "\n"; print $my_profile{"age"} . "\n"; print $my_profile{"food"} . "\n";
None
• .n #!/usr/bin/env perl $my_profile{'name'} = 'AnaTofuZ'; $my_profile{'age'} = 21;
$my_profile{'food'} = 'apple'; @keys = keys(my_profile); for ($i = 0; $i < $#keys+1 ; $i++){ print $keys[$i] . "\n"; } $my_profile{'age'} = ""; if ( $my_profile{'age'} == ""){ print "Age is not exists (͋Δ͚Ͳ)\n"; } else { print "Age is exitst"; }
hash_func.plͰൃ֮ͨ͠ • delete͕ͳ͍ • undef͕ͳ͍ • existͳ͍ • ϋογϡͰͳ͋͘͘·Ͱศརͳྻ (ͨͩ͠ྻͷshiftͳͲ͑ͳ͍)
Perl1.0ͷ࿈ྻ • ࿈ྻ͋͘·Ͱࢼݧతӡ༻ͩͬͨ • keys()ͳͲڥมͷऔಘͰར༻Λఆ • ͪͳΈʹιʔτॱࣙॻॱ
͍ۤ͠……
݁ • Perl5を使おう