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.7k
昔のGo, 今のGo ~比較, ソート編~
skaji
0
200
cpm at PerlCon 2019
skaji
0
110
Perl5 Package Manager
skaji
0
670
Internal of cpm
skaji
0
580
How to execute external programs in Perl
skaji
3
590
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
カンファレンス動画鑑賞会のススメ / Osaka.swift #1
hironytic
0
170
HTML/CSS超絶浅い説明
yuki0329
0
190
「とりあえず動く」コードはよい、「読みやすい」コードはもっとよい / Code that 'just works' is good, but code that is 'readable' is even better.
mkmk884
6
1.4k
ecspresso, ecschedule, lambroll を PipeCDプラグインとして動かしてみた (プロトタイプ) / Running ecspresso, ecschedule, and lambroll as PipeCD Plugins (prototype)
tkikuc
2
1.9k
Beyond ORM
77web
11
1.6k
DevFest - Serverless 101 with Google Cloud Functions
tunmise
0
140
Simple組み合わせ村から大都会Railsにやってきた俺は / Coming to Rails from the Simple
moznion
3
2.2k
Androidアプリの One Experience リリース
nein37
0
1.2k
サーバーゆる勉強会 DBMS の仕組み編
kj455
1
300
ATDDで素早く安定した デリバリを実現しよう!
tonnsama
1
1.9k
オニオンアーキテクチャを使って、 Unityと.NETでコードを共有する
soi013
0
370
KMP와 kotlinx.rpc로 서버와 클라이언트 동기화
kwakeuijin
0
300
Featured
See All Featured
How to Think Like a Performance Engineer
csswizardry
22
1.3k
Designing on Purpose - Digital PM Summit 2013
jponch
116
7.1k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
3
360
jQuery: Nuts, Bolts and Bling
dougneiner
62
7.6k
Optimising Largest Contentful Paint
csswizardry
33
3k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
29
960
Raft: Consensus for Rubyists
vanstee
137
6.7k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.6k
Making Projects Easy
brettharned
116
6k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.1k
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 ϞδϡʔϧΛ͏ͱΑ͍ɻ
͓ΘΓ