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.8k
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
初心者向けAWS Securityの勉強会mini Security-JAWSを9ヶ月ぐらい実施してきての近況
cmusudakeisuke
0
120
リンクアンドモチベーション ソフトウェアエンジニア向け紹介資料 / Introduction to Link and Motivation for Software Engineers
lmi
4
300k
Exadata Database Service on Dedicated Infrastructure(ExaDB-D) UI スクリーン・キャプチャ集
oracle4engineer
PRO
2
3.2k
ハイパーパラメータチューニングって何をしているの
toridori_dev
0
140
Oracle Cloud Infrastructureデータベース・クラウド:各バージョンのサポート期間
oracle4engineer
PRO
28
12k
開発生産性を上げながらビジネスも30倍成長させてきたチームの姿
kamina_zzz
2
1.6k
OCI Network Firewall 概要
oracle4engineer
PRO
0
4.1k
[FOSS4G 2019 Niigata] AIによる効率的危険斜面抽出システムの開発について
nssv
0
310
元旅行会社の情シス部員が教えるおすすめなre:Inventへの行き方 / What is the most efficient way to re:Invent
naospon
2
330
OCI Security サービス 概要
oracle4engineer
PRO
0
6.5k
Lexical Analysis
shigashiyama
1
150
Amazon Personalizeのレコメンドシステム構築、実際何するの?〜大体10分で具体的なイメージをつかむ〜
kniino
1
100
Featured
See All Featured
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
24k
Intergalactic Javascript Robots from Outer Space
tanoku
269
27k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
RailsConf 2023
tenderlove
29
900
Become a Pro
speakerdeck
PRO
25
5k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
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を使おう