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
990
ドキドキPerl調査団 Part1
Okinawa.pm #6の発表資料です
AnaTofuZ
March 17, 2018
Tweet
Share
More Decks by AnaTofuZ
See All by AnaTofuZ
令和最新版 Perlコーディングガイド
anatofuz
5
4.4k
rakulangで実装する! RubyVM
anatofuz
6
2k
沖縄の大学で育った学生がエンジニアになるまで
anatofuz
2
1.4k
OpenAPI Generator Perl Clientでも型チューニングしたい!!
anatofuz
0
270
perlimportsから探るPPIの世界
anatofuz
0
3.4k
GraphQLスキーマの設計で考えたこと
anatofuz
1
1.5k
インターネットアイドル目指して
anatofuz
1
180
How to build traditional Perl interpreters.
anatofuz
0
820
レガシーPython散策
anatofuz
2
1.8k
Other Decks in Technology
See All in Technology
KMPプロジェクトでマニュアルDIを使う選択
rmakiyama
0
120
Jamstack でリニューアルするグリーグループのメディア
gree_tech
PRO
2
220
現地でMeet Upをやる場合の注意点〜反省点を添えて〜
shotashiratori
0
160
バイセルにおけるAI活用の取り組みについて紹介します/Generative AI at BuySell Technologies
kyuns
1
200
GitHub Universe: Evaluating RAG apps in GitHub Actions
pamelafox
0
130
Capybara+生成AIでどこまで本当に自然言語のテストを書けるか?
yusukeiwaki
6
1.1k
新卒1年目が向き合う生成AI事業の開発を加速させる技術選定 / ai-web-launcher
cyberagentdevelopers
PRO
3
840
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
5
49k
ActiveRecord SQLインジェクションクイズ (Rails 7.1.3.4)
kozy4324
9
2.1k
Overview of file type identifiers
ange
0
210
KaigiOnRails2024
igaiga
6
3.6k
DFTの実践的基礎理論
pfn
PRO
2
100
Featured
See All Featured
GitHub's CSS Performance
jonrohan
1030
460k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
355
29k
Building Applications with DynamoDB
mza
90
6k
Into the Great Unknown - MozCon
thekraken
31
1.5k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
46
2.1k
Designing for Performance
lara
604
68k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
Measuring & Analyzing Core Web Vitals
bluesmoon
0
28
Fireside Chat
paigeccino
32
3k
Music & Morning Musume
bryan
46
6.1k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.8k
Imperfection Machines: The Place of Print at Facebook
scottboms
264
13k
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を使おう