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 Quiz
Search
Shoichi Kaji
May 21, 2021
Programming
0
130
Perl Quiz
Gotanda.pm 2021/05/21
Shoichi Kaji
May 21, 2021
Tweet
Share
More Decks by Shoichi Kaji
See All by Shoichi Kaji
宿泊予約サイトにおける検索と料金計算の両立
skaji
2
3.6k
昔のGo, 今のGo ~比較, ソート編~
skaji
0
180
cpm at PerlCon 2019
skaji
0
110
Perl5 Package Manager
skaji
0
660
Internal of cpm
skaji
0
580
How to execute external programs in Perl
skaji
3
580
Writing Perl with w0rp/ale
skaji
0
2.2k
nginx unit
skaji
0
44
Perl6 ecosystem
skaji
1
1.4k
Other Decks in Programming
See All in Programming
PHPUnitしか使ってこなかった 一般PHPerがPestに乗り換えた実録
mashirou1234
0
170
42 best practices for Symfony, a decade later
tucksaun
1
180
17年周年のWebアプリケーションにTanStack Queryを導入する / Implementing TanStack Query in a 17th Anniversary Web Application
saitolume
0
250
20年もののレガシープロダクトに 0からPHPStanを入れるまで / phpcon2024
hirobe1999
0
460
HTTP compression in PHP and Symfony apps
dunglas
2
1.7k
DevFest Tokyo 2025 - Flutter のアプリアーキテクチャ現在地点
wasabeef
5
900
[JAWS-UG横浜 #76] イケてるアップデートを宇宙いち早く紹介するよ!
maroon1st
0
460
Mermaid x AST x 生成AI = コードとドキュメントの完全同期への道
shibuyamizuho
0
160
「とりあえず動く」コードはよい、「読みやすい」コードはもっとよい / Code that 'just works' is good, but code that is 'readable' is even better.
mkmk884
3
270
From Translations to Multi Dimension Entities
alexanderschranz
2
130
return文におけるstd::moveについて
onihusube
1
1.1k
責務を分離するための例外設計 - PHPカンファレンス 2024
kajitack
1
650
Featured
See All Featured
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
25k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Docker and Python
trallard
42
3.1k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Writing Fast Ruby
sferik
628
61k
Raft: Consensus for Rubyists
vanstee
137
6.7k
Building a Scalable Design System with Sketch
lauravandoore
460
33k
Six Lessons from altMBA
skipperchong
27
3.5k
Rails Girls Zürich Keynote
gr2m
94
13k
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.4k
Transcript
Perl Quiz😆 Shoichi Kaji
Q1. ࣍ͷจষਖ਼͍͔͠? Time::Localύοέʔδʹ͓͍ͯ timelocalؔͰͳ͘ timelocal_modernؔΛ͏ ͜ͱ͕ਪ͞Ε͍ͯΔɻ
A1. ਖ਼͘͠ͳ͍
• timelocal جຊతʹ localtime ͷ"ٯ"Λఏڙ͢Δؔɻ Y,m,d,H,M,SΛड͚औΓunixtimeΛฦ͢ɻ • ͕ɺ"DWIM"ͳڍಈΛ͢Δ্ؔɺ 2020Λڥʹ݁Ռ͕มΘΔՄೳੑ͕͋Δ😨 •
͜ΕΛղܾ͘͢ɺܾఆతͳ݁ՌΛฦ͢ timelocal_modern͕༻ҙ͞Εͨɻ • ͕ɺͦΕগʑ͍·͍ͪͩͬͨͷͰɺݱࡏͰ timelocal_posixΛ͏͜ͱ͕ਪ͞Ε͍ͯΔɻ ͜Εlocaltimeͷਅͷ"ٯ"Λఏڙ͢Δɻ
Q2. ࣍ͷ ʹೖΔͷԿ͔? ֎෦ίϚϯυͷඪ४ग़ྗΛ ಘΔؔͱͯ͠ qx//, ``, ͕͋Δɻ
A2. readpipe
• rjbs͞ΜͷϒϩάಡΜͰ͍ͯɺ readpipeͱ͍͏͕ؔ͋Δ͜ͱΛ࠷ۙͬͨɻ • ಉ͡ಇ͖Λ͢ΔΈࠐΈ͕ؔ 3ͭ͋Δඞཁ...
Q3. PerlͰϋογϡϦϑΝϨϯεͱ ϒϩοΫʹಉ͡ه߸ {} Λ༻͍͍ͯΔɻ ͳΜΒ͔ͷཧ༝ͰϋογϡϦϑΝϨϯεΛ ໌͍ࣔͨ͠ͱ͖ +{} ͕ଟ༻͞ΕΔɻ ͰٯʹϒϩοΫΛ໌͍ࣔͨ͠ͱ͖
ͳΜͱॻ͘ͱΑ͍͔ʁ
A3. {; }
• metacpanΛோΊ͍ͯͨΒɺ App::UniϞδϡʔϧͰΘΕ͍ͯͯͬͨɻ • ࣮ࡍͷͱ͜Ζɺ+{}, {; } ຊʹඞཁͳॴগ ͳ͍ͱࢥ͏😇
Q4. Perl v5.16Ҏ্ʹ͓͍ͯ ࣮ߦϢʔβͷhomeσΟϨΫτϦ Λऔಘ͢Δ؆ศͳํ๏ʁ
A4. my $home = (<~>)[0];
• ΫϩεϓϥοτϑΥʔϜΛҙ্ࣝͨ͠Ͱ HomeσΟϨΫτϦΛऔಘ͢Δͷ݁ߏେมɻ • ͪΌΜͱΔͳΒFile::HomeDirϞδϡʔϧΛ͏ͷ͕ ΑΖ͍͠ɻ • "͋Δఔ"ͰेͳΒɺάϩϒ(glob,<>)Ͱ "~" Λ
ղܾͤͯ͞औಘ͢Δͷ͕ϥΫɻ • ͳ͓ɺPerl5.16ະຬҙ͍ࣝͨ͠ͳΒ File::HomeDir::TinyΛ͏ͱΑΖ͍͠ɻ
Q5. Perl͋ΔόʔδϣϯΑΓ @INCͷॱ൪͕มΘ͍ͬͯΔɻ มΘͬͨͷ࣍ͷ͏ͪͲΕ͔? (A) v5.10͔Β (B) v5.12͔Β (C) v5.14͔Β
A5. (B) v5.12͔Β
• @INCϞδϡʔϧαʔνύε͕ೖ͍ͬͯΔมɻ • @INCجຊతʹ * 1൪: CPANϞδϡʔϧೖΔsitelib * 2൪: coreϞδϡʔϧ͕ೖΔcorelib
ʹΑͬͯߏ͞ΕΔɻ • ͕ɺ5.10Ҏલcorelib, sitelibͷॱʹͳ͍ͬͯͨɻ • ͦͷ্ؔɺ5.10ҎલͰdual lifeϞδϡʔϧΛΠϯετʔϧ͢Δ ͱɺcorelibʹ্ॻ͖͞ΕΔɻ • CartonͷޙܧCarmel͕v5.12Λཁٻ͍ͯ͠Δͷ͜Ε͕ཁҼɻ
Q6. ҎԼͷίʔυΛWindowsͰ࣮ߦ͢Δͱ ʮHello, World!ʯ ͱදࣔ͞ΕΔɺ͞Εͳ͍?
A6. දࣔ͞Εͳ͍
• Windowsʹ͓͍ͯ ͨͱ͑ system LIST ܗࣜͰ͋ͬͯ ಛघจࣈΛΫΦʔτ͠ͳ͍ͱ͍͚ͳ͍Մೳੑ͕͋ Δɻ • ઌͷྫͩͱಛʹʮ"ʯ͕ͱͳͬͯ
ʮHello World!ʯͱදࣔ͞Εͳ͍ɻ • Windows༻ͷΫΦʔτʹɺWin32::ShellQuote ϞδϡʔϧΛ͏ͱΑ͍ɻ
͓ΘΓ