Upgrade to Pro — share decks privately, control downloads, hide ads and more …

はてなリモートインターン2021 Perlブートキャンプ 講義資料

49f49940f0831a426745c028684bcdad?s=47 hatena
October 08, 2021

はてなリモートインターン2021 Perlブートキャンプ 講義資料

49f49940f0831a426745c028684bcdad?s=128

hatena

October 08, 2021
Tweet

Transcript

  1. )BUFOB3FNPUF*OUFSOTIJQ &9铺紶 1FSMه٭ع؞ٔ٤و JEUL[XULT悂很㼵

  2. 舅䄕磆☭ ˝ JEUL[XULT悂很㼵 ˝ 䇗僖⪌炘 ˝ 哅ⳉ塷 ˝ ؜ؠّٙ ˝

    (JHB7JFXFS ˝ עיםرؕؓٛ٭磙▼ ˝ 뇧嫎סJ׼؆ל
  3. 1FSM鐆؆ד׆כ傴ַג׆כֵ׽ױ ׌־

  4. 1FSM

  5. 1FSM 1FSMق٭ٜכעյٚٛ٭٬ؚؗ٭ٜמ׻זיꝧ氦׈׿גوٞ ءِٚ٤ء銧鏤ךֵ׾ն㲔榫䓪כ㛡喋䓪؅ꄆ釱׊יֽ׽յ$銧鏤 ׷TFEյBXLյبؘٜتؠٛوعםל☽סوٞءِٚ٤ء銧鏤ס⨣ ׿ג嚀耆؅⹦׽⪌׿יַ׾նؘؗه٬ؓوٛآ٭ب٘٤յبتط ّ畘杼յط؞تع⭚杼םלסوٞءّٚ؅傴ׂסמ䇶ׂ榫ַ׼׿ יַ׾ն

  6. 1FSM ˝ (Pכ鷿זיյؤ٤قٜؕ؅׊םַؕ٤ذوٛذ㑔銧鏤 ˝ #FUUFSTIFMMכ׊י׵✳ֻ׾׊յؘؗهؓوٛآ٭ب٘٤؅ 傴ׂ׆כדזיך׀׾ ˝ 碛企ַؘؗهꝧ氦ס鷹⪮כ׊יյ⹿ׂ־׼☔妳ס-JHIUXFJHIU -BOHVBHF ˝

    עים%F/"NJYJ-*/& ˝ ײם׈؆ֿ鿥㷯׈׿׾◀㲊סز٭ّך׵
  7. إ٭ٜ 侇ꝴ䍚ךր1FSM㱭⪒מ杼鉮׊גցמם׾

  8. إ٭ٜ סע׵ה؀؆ꦘ׊ַסך ˝ 仴㰆סؤ٭غ؅鐆׳ג״ס⹦ז䫇־׽ֿ⛼׿׾׻ֹמם׾ ˝ ㍭זגכ׀סؕ٤ظشؠتכ׊י ˝ ⼽׽סؤ٭غ؅⹆縒מ׊םֿ׼1FSMֿ傴ׄ׾׻ֹמם׾

  9. 1FSMמ鉴׿יַׂ⯥מ

  10. غ؞ْٖ٤عעQFSMEPDך䌕ׂ % perldoc Carton # Ϟδϡʔϧʢޙड़ʣͷυΩϡϝϯτ % perldoc -f print

    # ૊ΈࠐΈؔ਺͸ -f % perldoc -v !" # ૊ΈࠐΈม਺͸ -v % perldoc perl
  11. $1"/ ˝ 5IF$PNQSFIFOTJWF1FSM"SDIJWF/FUXPSL ˝ IUUQTNFUBDQBOPSH ˝ ┩槡╈ס׈ױ׉ױם1FSMٓةٖ٭ֿٜ꥗ױזיַ׾ ˝ 1FSMס銧鏤氳ם䍚ײס┉חؤِٖؼطؔ

  12. $BSUPO ˝ 3VCZךַֹ#VOEMFSײגַם׵ס ˝ cpanfileמ傴ַגٓةٖ٭ٜ⺲!ف٭ة٘٤؅յٞ٭؜ٜס ظؔٝؠعٛlocal/מؕ٤تع٭ٜ׊יׂ׿׾ ˝ ز٭ّךע%PDLFS✳ֹסךֵױ׽ゖ갭מעם׼םַ־׵

  13. 1FSMכַֹ銧鏤

  14. ˝ ٓةٖ٭ٜ package Example!"Greeter; use strict; use warnings; sub greet

    { my ($class, $what) = !#; print "hello, $what\n"; } 1;
  15. ˝ ْؕ٤تؠٛوع use strict; use warnings; use lib 'lib'; use

    Example!"Greeter; Example!"Greeter!#greet('world'); ˝ 㲔车 % perl -Ilib main.pl hello, world
  16. ֽױ׋םַ ˝ VTFTUSJDUVTFXBSOJOHT ˝ 碛ס1FSMע־ם׽舅榺 ˝ VTFTUSJDU׌׾כNZך㲚銧׊יַםַ㚺丗ֵֿ׾כꪐ氳מ ؙٚ٭ ˝ VTFXBSOJOHT׌׾כ閛⼔ֿ僗Ⲗמם׾

    ˝ 鎋׊ׂעQFSMEPDTUSJDUQFSMEPDXBSOJOHT
  17. 㚺丗 ˝ 1FSMס㚺丗עյאסظ٭ذ㑔מ䑴׋יبةٜכ⽛ף׿׾鋗⺘ֿ ⩝꯽מחׂ ˝ my $hogeס׻ֹמ׊י㚺丗㲚銧׌׾ ˝ ꪐ氳ם㑔עםַ ˝

    $@%
  18. ت؜ٚ ˝ חס⡁ ˝ 丗㰄׵乃㰄⮛׵׌׬יت؜ٚ my $scalar1 = 'test'; my

    $scalar2 = 1000; my $scalar3 = \@array; # ϦϑΝϨϯεʢޙड़ʣ ˝ ׷狜乃㰄⮛עGBMTZם⡁כ׊י䣽؂׿׾ ˝ ׵GBMTZ
  19. VOEFG ˝ ت؜ٚ㚺丗ס⮣僿⡁ ˝ ַ؂׹׾VOEFOFEכ־OJMכ־ ˝ EFOFE磝ײ鱮ײ㚺丗ךVOEFG־לֹ־زؘشؠך׀׾ my $x; print

    $x; # "Use of uninitialized value $x in print"
  20. !鿥⮛ my @array = ('a', 'b', 'c');

  21. 鿥⮛׫סؓؠجت print $array[1]; # !" b ˝ 鿥⮛סַה釐碛עت؜ٚםסךյؓؠجت׌׾㕙⺬עBSSBZ<> מם׾ ˝

    BSSBZכ!BSSBZע⮯擻
  22. 鿥⮛ס䳩⛼ $array[0]; # get $array[1] = 'hoge'; # set push

    @array, 'meow'; # ࠷ޙʹཁૉΛ௥Ճ my $v = shift @array; # ࠷ॳͷཁૉΛऔΓআ͍ͯฦ͢ my $length = scalar @array; # ௕͞ for my $e (@array) { # શཁૉϧʔϓ print $e; }
  23. 鿥⮛ס䳩⛼ my @doubles = map { $_ * 2 }

    @numbers; # ͢΂ͯΛ2ഒʹͨ͠഑ྻΛ࡞Δ my @over20 = grep { $_ > 20 } @numbers; # 20ΑΓେ͖ͳ਺͚ͩΛूΊͨ഑ྻΛ࡞Δ ˝ $_ע攐墤㚺丗 ˝ ׆ס㕙⺬ךע鿥⮛ס⺨釐碛ֿꯂמ⹦׽⭳׈׿י⪌זיׂ׾
  24. ـشبٖ ˝ ַ؂׹׾ظؔؠب٘ػٛ׷ُشو my %hash = ( perl !" 'larry',

    ruby !" 'matz', ); ˝ עGBUDPNNBכ⽛ף׿յ QFSMMBSSZ ע QFSM  MBSSZ כ⺱┉ ˝ ⺓鱨ע鿥⮛סכ׀כ⺱喋םٛتعדֿյל؆ם㚺丗מ劲硯׌׾ ־ךؓؠجتס☼亠ֿ㚺؂׾ ˝ ؤ٤ط؞تع
  25. ٛنؒٝ٤ت ˝ כי׵ꄆ釐 ˝ ٛنؒٝ٤تت؜ٚ鿥⮛ـشبٖםל׫ס⹆拨 ˝ 1FSMס鿥⮛׷ـشبٖע־ם׽碛儢 ˝ 邾ꥭםظ٭ذ啶鵰؅⛼׾㕙⺬מ䑒׍䑒釐מם׾

  26. ٛنؒٝ٤ت ˝ ⪌׿㯸ס车⮛؅⛼זיײ׾־ my @matrix = ( (0, 1, 2,

    3), (4, 5, 6, 7), ); ˝ ׆סؤ٭غע鿥⮛ס⺬䡗מם׾ ˝ ٛتع؅⪌׿㯸מך׀םַ my @matrix = (0, 1, 2, 3, 4, 5, 6, 7);
  27. א׆ךٛنؒٝ٤ت my @array = ('a', 'b', 'c'); my $ref =

    \@array; # @array ΁ͷϦϑΝϨϯε my $ref = ['a', 'b', 'c']; # ্هͷུهɻͪͳΈʹ \('a', 'b', 'c') ͸ผ෺ # 2ͭͷ഑ྻ΁ͷϦϑΝϨϯεΛ΋ͬͨʢ௕͞2ͷʣ഑ྻ my @matrix = ( [0, 1, 2, 3], [4, 5, 6, 7], );
  28. 鿥⮛ٛنؒٝ٤ت׫סؓؠجت my @array2 = @$ref; # ಄ʹ @ Λ͚ͭͯ഑ྻʹ໭͢ʢσϦϑΝϨϯεʣ print

    $ref!"[1]; # !" Λ࢖ͬͯ௚઀ΞΫηε
  29. ـشبٖٛنؒٝ٤ت my %hash = ( perl !" 'larry', ruby !"

    'matz', ); my $ref = \%hash; # ུه my $ref = { perl !" 'larry', ruby !" 'matz', };
  30. ـشبٖٛنؒٝ٤ت׫סؓؠجت my $ref = { perl !" 'larry', ruby !"

    'matz', }; # % Λ಄ʹ͚ͭͯσϦϑΝϨϯε # keys͸૊ΈࠐΈؔ਺ɻϋογϡͷΩʔͷҰཡΛऔಘ͢Δ my @keys = keys %$ref; print $ref!#{perl}; # !# Ͱ௚઀ΞΫηε
  31. ظٛنؒٝ٤تַ؀ַ؀ ˝ םמ־ס䌋؅ظٛنؒٝ٤ت׌׾כ׀ע!\^כ־\^ך ㍱׳ my $a_of_a = [ [1, 2,

    3], [4, 5, 6], ]; my @array = @{ $a!"[1] };
  32. ˝ 1PTUYEFSFGFSFODF my @array = $a!"[1]!"@*;

  33. 塜釨辐杯 ˝ 1FSMס䍚ײסץכחն״ה׶䍚ⱱ ˝ ך塜釨辐杯ٛطٜٚ؅榟䡗յ_ך乃㰄⮛מُشز׈׎׾ my ($id) = ("͜Μʹͪ͸ɺid:motemen Ͱ͢"

    =~ /id:(.+)/); # จࣈྻϚονͰҰ෦Λൈ͖ग़͢ my @lines = split /\n/, $text; # ೖྗΛߦʹ෼ׂ ˝ QFSMEPDQFSMSF
  34. אס׮־ ˝ if乃כ־ע䘶⥼鵟׽ס׵סֿדַגֵַ׾ ˝ else ifעםׂיelsif ˝ ٜ٭وס⯆䐒啶乃 ˝ continueעnext

    breakעlast ˝ 乃㰄⮛ס奂鬳ע!"םלךעםׂeq ˝ QFSMEPDQFSMPQ
  35. אס׮־ ˝ 乃㰄⮛ס磵⺬ע غشع璡 $hoge = 'abc' . 'def' #

    abcdef ˝ qw(foo bar baz)ע('foo', 'bar', 'baz')ס矴辉啶乃 ˝ perldoc -f qw
  36. ؤ٤ط؞تع ˝ 1FSMסꦘ׊ַכ׆؀סץכח ˝ 䌋؅鍐❫׌׾꤀מ縒䜡׌׾䑒釐ֵֿ׾ ˝ ت؜ٚؤ٤ط؞تعכٛتعؤ٤ط؞تعֵֿ׾ my @array =

    (10, 20, 30); my @x = @array; # ͜ͷ @array ͸ϦετίϯςΩετͰධՁ͞ΕΔ my $y = @array; # ͜ͷ @array ͸εΧϥίϯςΩετͰධՁ͞ΕΔ my ($z) = @array; # ͜ͷ @array ͸ϦετίϯςΩετͰධՁ͞ΕΔ
  37. ؤ٤ط؞تع ˝ @xֿ(10, 20, 30)מם׾סעױֵ舅抅 ˝ ךע$yע ˝ $y !"

    3 ˝ 鿥⮛؅ت؜ٚؤ٤ط؞تعך鍐❫׌׾כאסꝎ׈؅鲭׌ ˝ $zמע鿥⮛ס⩝꯽釐碛ֿ♏⪌׈׿$z !" 10鿥⮛ס墦׽ ע䩰י׼׿׾
  38. ؤ٤ط؞تعס׻ֵׂ׾粸 ם؆־ٗ٭ا־׼鴜׼׿ג⪌ⱱ؅⹨ׄכ׽յٛتعؤ٤ط؞تع ךע鿥⮛؅鲭׌꞊丗param()ֵֿזגכ׊י my $in = { name !" param('key')

    # ͜ͷؔ਺ݺͼग़͠͸ϦετίϯςΩετͰධՁ͞ΕΔ };
  39. ؤ٤ط؞تعס׻ֵׂ׾粸 my $in = { name !" ('foo', 'bar', 'baz')

    }; my $in = { name !" 'foo', bar !" 'baz', }; כַֹ䚉׋מם׽յם׏־CBSכַֹ┘䓙閱ם؞٭ֿ榟ֻյ┘⺎鉮 םفءס⸉㍔כם׽ֹ׾
  40. ؤ٤ط؞تعؠؕث sort <͜͜>; length <͜͜>; if (<͜͜>) { } for

    my $i (<͜͜>) { } $obj!"method(<͜͜>); my $x = <͜͜>; my ($x) = <͜͜>; my @y = <͜͜>; my %hash = ( key0 !# 'hoge', key1 !# <͜͜>, ); scalar(<͜͜>); <͜͜>;
  41. ؤ٤ط؞تعؠؕث鉮璻 sort <Ϧετ>; length <Ϧετ>; if (<εΧϥ>) { } for

    my $i (<Ϧετ>) { } $obj!"method(<Ϧετ>); my $x = <εΧϥ> my ($x) = <Ϧετ>; my @y = <Ϧετ>; my %hash = ( key0 !# 'hoge', key1 !# <εΧϥ>, ); scalar(<Ϧετ>); <εΧϥ>;
  42. ꞊丗ئهٜ٭ز٤ sub foo { my ($a, $b, $c) = !";

    } ס׻ֹמ㲚銧׊י foo(1, 2, 3); ך⽛צ⭳׌ն䌕丗ם׊ס꞊丗⽛צ⭳׊ע؜شؤ泸樋ך׀׾
  43. 䌕丗ס⹨ׄ⹦׽亠 sub add { my ($x, $y) = !"; return

    $x + $y; } my $three = add(1, 2); ˝ add(1,2)כ⽛צ⭳׊גכ׀ס䌕丗ע!"כַֹ攐墤ם鿥⮛מ 劲硯׈׿׾ ˝ ׆׿ֿ($x, $y)מ⮆Ⱏ♏⪌׈׿׾
  44. 䌕丗ס⹨ׄ⹦׽亠 ˝ shift؅✳ֹ ˝ 䌕丗ם׊סshiftע倊랺氳מ!"؅䌕丗מ⹦׾ ˝ my $arg1 = shift;כ׌׾כ!"ס⩝꯽釐碛ֿ$arg1מ♏⪌

    ׈׿׾ ˝ !"ע鿥⮛םסך ˝ my $arg1 = $_[0]ך僃⮣ס䌕丗מؓؠجت׌׾׆כ׵ך׀ ׾
  45. 䌕丗⭚杼ؕظؔ؛ّ sub func1 { my ($arg1, $arg2, %args) = !";

    my $opt1 = $args{opt1}; my $opt2 = $args{opt2}; } func1('hoge', 'fuga', opt1 !# 1, opt2 !# 2); 僃䏲מ%argsכ⹨ׄ׾׆כך泸樋⺎耆ם⺲⯥♀׀䌕丗؅㲔杯 ך׀׾
  46. ⡁ס鲭׊亠 ˝ returnך鲭׎׾ֿյ泸樋⺎耆 ˝ 泸樋׊ג㕙⺬ע僃䏲מ鍐❫׈׿ג䌋ס磵冽ֿ鲭׽⡁כם׾ ˝ 䙫㍲ֿ؂־׽ט׼ׂם׾סך傴׀ױ׊׺ֹ

  47. ٓةٖ٭ٜبتطّ ˝ قشآ٭ة package Example!"Greeter; כ傴ׂכյ♓꡸סخ٭تؤ٭غעExample!"Greeterכַֹ⺲⯥ 狜ꝴמ㷯׌׾ قشآ٭ةכע꞊丗ס⺲⯥ֿ䢥㷯׌׾⩝յכ縒ֻ׾כ荁ַ

  48. ٓةٖ٭ٜبتطّ ˝ قشآ٭ة package A; sub foo { !!" }

    package B; sub bar { !!" } א׿ב׿A!"foo()B!"bar()ך꞊丗؅⹆拨ך׀׾
  49. ٓةٖ٭ٜبتطّ哭釐 ˝ use Foo!"Bar!"Baz ˝ lib/Foo/Bar/Baz.pmֿ鐆ײ鱮ױ׿յFoo!"Bar!"Baz⺲ ⯥狜ꝴֿ⛼׼׿׾ ˝ 1FSMס㲔车نٜؒؕע.plٓةٖ٭ٜע.pm䦡䍖㯸 ˝

    㲔ⳉך傴ׂסע׮כ؆ל.pm
  50. ٓةٖ٭ٜبتطّ哭釐 ˝ VTF׊גכ׀סنٜؒؕס䫒碟⩝ע@INCכַֹءٞ٭فٜם攐 墤㚺丗מ劲硯׈׿יַ׾ ˝ 䜉綗氳מյوٞةؘؠع泡┖ס./lib؅@INCמ⪌׿׾׻ֹ啶 䡗׈׿יַ׾ ˝ @INC؅泡䫘䳩⛼׊ג׽յperl -Ilibך颯Ⳃ׌׾

    ˝ perldoc -f useperldoc -v @INC
  51. ⪯㑔氳םٓةٖ٭ٜ package Foo!"Bar!"Baz; use strict; use warnings; # ͜ͷύοέʔδͷ֎͔Β͸ Foo!"Bar!"Baz!"public_function

    ͰΞΫηεͰ͖Δͧ sub public_function { !!# } # ඇެ։ͳؾ෼ͷϝιου͸ _ Ͱ͸͡ΊΔͧɻؾ෼͚ͩͳͷͰ֎͔ΒΞΫηε΋Ͱ͖ͪΌ͏͕ɻ sub _private_function { !!# } # Ϟδϡʔϧͷ࠷ޙʹ͸͔ͳΒͣਅ஋Λه͢ɻͦ͏͠ͳ͍ͱ use ͕ࣦഊ͢Δͧɻ 1;
  52. 鉮鐄 ˝ VTF.0%6-&GPP CBSךٓةٖ٭ٜמ榟ֻיַ׾꞊丗؅ؕ ٤َ٭عך׀׾ ˝ 儖䎎ע׵ֹ㵼׊娆榫氳ך邾ꥭדֿյ׆ס杼鉮ך㍭׼םַ ˝ VTFס䌕丗ם׊ך׵ⳏ䣆מؕ٤َ٭ع׊יׂ׿׾ٓةٖ٭ٜ׵ ֵ׾

    ˝ %BUB%VNQFS+40/םל
  53. ؛هةؘؠع䧗⺸ ˝ 1FSMע׵כ׵כ؛هةؘؠع䧗⺸銧鏤כ׊י㡎ױזג؂ׄךע םַסך䏲♀ׄ ˝ ֿյ俊鵟מ✳ֻ׾ ˝ قشآ٭ةכٛنؒٝ٤تֿ؂־זיַ׿ףյ׮ׯ؜ف٭ך׀ ׾

  54. ׆׆ך؛هةؘؠع䧗⺸מחַי縒 ֻ׻ֹ

  55. ؛هةؘؠع䧗⺸כע ˝ ׌ׇׂ癨ⶡמ銧ֻףظ٭ذ啶鵰כ䣆禈׀؅┉稇מ׊ג׵ס ˝ ؛هةؘؠعעؠٚت־׼榟䡗׈׿׾ ˝ ؛هةؘؠعעظ٭ذ؅䧏ח ˝ ؠٚتמעظ٭ذמ㵚׌׾䣆禈׀ْخشغֿ㲊紶׈׿י ַ׾

  56. 1FSMמֽׄ׾001 001מֽׄ׾榫鏤 1FSMךס榫鏤 ؠٚت قشآ٭ة ْخشغ قشآ٭ةמ㲊紶׈׿ג꞊丗 ؛هةؘؠع قشآ٭ةמCMFTT ׈׿גٛن

    ؒٝ٤ت
  57. CMFTT ˝ CMFTTֿ؛هةؘؠع䧗⺸1FSMמֽׄ׾僃䏲ס氧㕙☔擻 # ͳΜ͔σʔλ͕͋Δʢී௨͸ϋογϡϦϑΝϨϯεʣ my $data = { name

    !" 'motemen' }; # σʔλʹύοέʔδΛඥ෇͚Δͱ my $self = bless $data, 'Hatena!#Engineer'; # ϝιου͕ݺ΂Δʂ ͜͜Ͱ͸ Hatena!#Engineer!#tweet $self!$tweet();
  58. ͍͍͔ɺΈΜͳ ɹɹɹɹɹɹɹɹ ƅшƅ ) ɹɹɹɹɹɹɹɹ(|ɹy |) ϋογϡϦϑΝϨϯεͱ package Ͱ͸खଓ͖ܕϓϩάϥϛϯά͔͠Ͱ͖ͳ͍͕ ɹɹɹɹɹ

    {}ɹ (ƅшƅ)ɹpackage ɹɹɹɹɹɹɹʘʗ|ɹy |ʘʗ ɹɹɹɹೋͭ߹Θ͞Ε͹OOPͱͳΔ ɹɹɹɹɹɹɹɹ(ƅшƅ)ɹ bless ɹɹɹɹɹɹɹɹ(ʘʗʘʗ
  59. ؤ٤تعٚؠذ ˝ ؤ٤تعٚؠذ׵舅⮆ך傴ׂն俊鵟עOFXכַֹ⺲⯥؅✳ֹ ˝ ֿյאַֹֹ⯆硜ֵֿ׾؂ׄךעםַն鷿ֹ⺲⯥סؤ٤تع ٚؠذ؅⛼׾׆כ׵ך׀׾

  60. ؤ٤تعٚؠذ package Person; use strict; use warnings; sub new {

    my ($class, %args) = !"; return bless \%args, $class; }
  61. ✳ַ亠 my $person = Person!"new(age !# 18); # { age

    !# 18 } ͕ Person ʹ bless ͞Εͨ΋ͷ
  62. ✳ַ亠 ˝ 1FSTPOOFX BHF ע1FSTPOOFX 1FSTPO BHF  ס矴辉啶乃 ˝

    ׆ֹ׷זיؠٚتْخشغ؅㲊紶׌׾ ˝ CMFTT׈׿יַי׵ـشبٖٛنؒٝ٤تךֵ׾׆כמ㚺؂׽ע םַ ˝ QFSTPO\BHF^ך╈骰מؓؠجت׌׾׆כ׵⺎耆
  63. ْخشغ package Person; use strict; use warnings; sub new {

    my ($class, %args) = !"; return bless \%args, $class; } sub age { my ($self) = !"; return $self!#{age}; } sub incr_age { my ($self) = !"; $self!#{age}!$; }
  64. ْخشغ $person!"incr_age; ˝ QFSTPOJODSBHF@עQFSTPOסCMFTT⩝ךֵ׾1FSTPO؅ג לזיյ磵㷀1FSTPOJODS@BHF QFSTPO כ⺱喋 ˝ ׆ֹ׷זיؕ٤تذ٤تْخشغֿ㲊紶ך׀׾

  65. ْخشغ⽛צ⭳׊ױכ״ # ͜ͷೋ͕ͭ౳Ձ Class!"method($arg1, $arg2); Class!#method('Class', $arg1, $arg2); # ͜ͷೋ͕ͭ౳Ձ

    $object!"method($arg1, $arg2); Class!#method($object, $arg1, $arg2);
  66. 禆䤔 package Animal; use strict; use warnings; sub new {

    !!" } sub walk { !!" } 1; package Dog; use strict; use warnings; use parent 'Animal'; 1;
  67. 禆䤔 my $dog = Dog!"new(); $dog!"walk(); # Animal!#walk ͕ݺ͹ΕΔ ˝

    ☼磝ײכ׊יע⺎耆דׄלֵױ׽僃鲣ע✳؂׿יַםַ ˝ 1FSM舅⛮ֿ*%&סئَ٭ع؅⹨ׄט׼ַ扛ַ؂ׄךעםַ ˝ 邾ꥭמם׾
  68. ؛هةؘؠع䧗⺸ױכ״ ˝ 䣆⛼׽䚉ֵר׿׾؛هةؘؠع䧗⺸ ˝ قشآ٭ةמ䣆禈׀؅㲊紶 ˝ CMFTTךظ٭ذכ磵צחׄ׾ ˝ ؤ٤تعٚؠذע舅⮆ךחׂ׾յ؛هةؘؠع׵舅⮆ך⛼׾ ˝

    ؛هةؘؠع䧗⺸겧מ⽛צ⭳׎׾׻ֹם矴辉
  69. ➘⮵ם$1"/ٓةٖ٭ٜ package Foo; use strict; use warnings; use Class!"Accessor!"Lite (

    new !# 1, ro !# ['bar'], ); 1; my $foo = Foo!"new(bar !# 1); # new Ͱ͖ͯΔ $fop!"bar; # bar ϝιου΋ੜ͑ͯΔ
  70. طتع طتع؅傴ׂؙؤبتطّ׵׀ה؆כ丝זיַ׾ ˝ QSPWFכַֹطتع㲔车榫סؤُ٤غֿ⺱卲׈׿יַ׾ ˝ طتعעUظؔٝؠعٛ♓┖מ糋ׂ ˝ 䦡䍖㯸עU╈骰ע1FSM

  71. طتع use strict; use warnings; use Test!"More; use Person; my

    $person = Person!#new(age !$ 18); is $person!#age, 18, '࠷ॳ͸18ࡀ'; $person!#incr_age; is $person!#age, 19, 'incr_age ݺΜͩΒ19ࡀ'; done_testing;
  72. طتع % prove -Ilib -v t/Person.t t/Person.t !" ok 1

    - ࠷ॳ͸18ࡀ ok 2 - incr_age ݺΜͩΒ19ࡀ 1!"2 ok All tests successful. Files=1, Tests=2, 0 wallclock secs ( 0.01 usr 0.01 sys + 0.04 cusr 0.00 csys = 0.06 CPU) Result: PASS
  73. 5FTU$MBTT package t!"Person; use strict; use warnings; use parent 'Test!"Class';

    sub setup : Test(setup) { # ͳʹ͔ෆࢥٞͳຐ๏Ͱؔ਺໊ͷ͋ͱʹΞϊʔςʔγϣϯͰ͖Δ # ֤ςετલͷηοτΞοϓʢม਺ΛΫϦΞͨ͠Γͱ͔ʣ } sub incr_age : Tests { is !!#; }
  74. כַֹ׆כך ˝ 껮ׄ餉דׄל1FSMס㓹灄־׼؛هةؘؠع䧗⺸وٞءِٚ٤ء ס鎇ױך׊ױ׊ג ˝ 1FSMמֽׄ׾8FCؓوٛס鎇׵ך׀׾כ荁־זגׄל侇ꝴ氳 מ☪㍑ע׆׆ױך ˝ 全鶚־׼ַ׻ַ׻ز٭ّמ⪌זיַׂ׆כמם׽ױ׌ն⼽׽ס עים炘⿦؅ל؆ל؆갔זיׂד׈ַ

    ˝ ײ؆ם⨣׊ׂ䷷ֻיׂ׿׾כ䓙ַױ׌