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
LLM Supervised Fine-tuningの理論と実践
datanalyticslabo
7
1.3k
PSR-15 はあなたのための ものではない? - phpcon2024
myamagishi
0
130
php-conference-japan-2024
tasuku43
0
310
暇に任せてProxmoxコンソール 作ってみました
karugamo
2
720
Jakarta EE meets AI
ivargrimstad
0
250
Асинхронность неизбежна: как мы проектировали сервис уведомлений
lamodatech
0
780
テストコード書いてみませんか?
onopon
2
120
rails stats で紐解く ANDPAD のイマを支える技術たち
andpad
1
290
フロントエンドのディレクトリ構成どうしてる? Feature-Sliced Design 導入体験談
osakatechlab
8
4.1k
CQRS+ES の力を使って効果を感じる / Feel the effects of using the power of CQRS+ES
seike460
PRO
0
130
MCP with Cloudflare Workers
yusukebe
2
220
テストコード文化を0から作り、変化し続けた組織
kazatohiei
2
1.5k
Featured
See All Featured
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
810
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.3k
What's in a price? How to price your products and services
michaelherold
243
12k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
5
450
Documentation Writing (for coders)
carmenintech
66
4.5k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
Building an army of robots
kneath
302
44k
Visualization
eitanlees
146
15k
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 ϞδϡʔϧΛ͏ͱΑ͍ɻ
͓ΘΓ