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
ハッキングの世界に迫る~攻撃者の思考で考えるセキュリティ~
nomizone
13
5.2k
Datadog APM におけるトレース収集の流れ及び Retention Filters のはなし / datadog-apm-trace-retention-filters
k6s4i53rx
0
330
Classmethod AI Talks(CATs) #17 司会進行スライド(2025.02.19) / classmethod-ai-talks-aka-cats_moderator-slides_vol17_2025-02-19
shinyaa31
0
110
株式会社EventHub・エンジニア採用資料
eventhub
0
4.3k
Developers Summit 2025 浅野卓也(13-B-7 LegalOn Technologies)
legalontechnologies
PRO
0
660
スタートアップ1人目QAエンジニアが QAチームを立ち上げ、“個”からチーム、 そして“組織”に成長するまで / How to set up QA team at reiwatravel
mii3king
2
1.4k
明日からできる!技術的負債の返済を加速するための実践ガイド~『ホットペッパービューティー』の事例をもとに~
recruitengineers
PRO
3
390
速くて安いWebサイトを作る
nishiharatsubasa
10
12k
Classmethod AI Talks(CATs) #16 司会進行スライド(2025.02.12) / classmethod-ai-talks-aka-cats_moderator-slides_vol16_2025-02-12
shinyaa31
0
100
トラシューアニマルになろう ~開発者だからこそできる、安定したサービス作りの秘訣~
jacopen
2
2k
2/18/25: Java meets AI: Build LLM-Powered Apps with LangChain4j
edeandrea
PRO
0
110
プロダクトエンジニア構想を立ち上げ、プロダクト志向な組織への成長を続けている話 / grow into a product-oriented organization
hiro_torii
0
110
Featured
See All Featured
Fireside Chat
paigeccino
34
3.2k
KATA
mclloyd
29
14k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
4
330
Mobile First: as difficult as doing things right
swwweet
223
9.3k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
GraphQLとの向き合い方2022年版
quramy
44
13k
Large-scale JavaScript Application Architecture
addyosmani
511
110k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
4
410
Typedesign – Prime Four
hannesfritz
40
2.5k
Writing Fast Ruby
sferik
628
61k
Done Done
chrislema
182
16k
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を使おう