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.6k
rakulangで実装する! RubyVM
anatofuz
6
2.1k
沖縄の大学で育った学生がエンジニアになるまで
anatofuz
2
1.5k
OpenAPI Generator Perl Clientでも型チューニングしたい!!
anatofuz
0
270
perlimportsから探るPPIの世界
anatofuz
0
3.5k
GraphQLスキーマの設計で考えたこと
anatofuz
1
1.5k
インターネットアイドル目指して
anatofuz
1
190
How to build traditional Perl interpreters.
anatofuz
0
830
レガシーPython散策
anatofuz
2
1.8k
Other Decks in Technology
See All in Technology
Deno+JSRでパッケージを作って公開する
askua
0
120
いろんなものと両立する Kaggleの向き合い方
go5paopao
2
1.1k
인디 앱 개발자와 Flutter
tinyjin
0
150
B2B SaaS × AI機能開発 〜テナント分離のパターン解説〜 / B2B SaaS x AI function development - Explanation of tenant separation pattern
oztick139
1
130
Windows Autopilot Deployment by OSD Guy
tamaiyutaro
0
380
Terraform未経験の御様に対してどの ように導⼊を進めていったか
tkikuchi
2
370
スクラム成熟度セルフチェックツールを作って得た学びとその活用法
coincheck_recruit
1
110
AIチャットボット開発への生成AI活用
ryomrt
0
150
Platform Engineering for Software Developers and Architects
syntasso
1
450
Terraform Stacks入門 #HashiTalks
msato
0
320
マルチプロダクトな開発組織で 「開発生産性」に向き合うために試みたこと / Improving Multi-Product Dev Productivity
sugamasao
1
280
第23回Ques_タイミーにおけるQAチームの在り方 / QA Team in Timee
takeyaqa
0
260
Featured
See All Featured
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
GitHub's CSS Performance
jonrohan
1030
460k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
830
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
Bash Introduction
62gerente
608
210k
Writing Fast Ruby
sferik
627
61k
Faster Mobile Websites
deanohume
305
30k
A better future with KSS
kneath
238
17k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
Into the Great Unknown - MozCon
thekraken
32
1.5k
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を使おう