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

ドキドキPerl調査団 Part1

AnaTofuZ
March 17, 2018

ドキドキPerl調査団 Part1

Okinawa.pm #6の発表資料です

AnaTofuZ

March 17, 2018
Tweet

More Decks by AnaTofuZ

Other Decks in Technology

Transcript

  1. Α͘Θ͔ΔPerl • Perl1.0 —ɹ͋ͬͨΒ͍͠ • Perl2 - Տ໺ઌੜ͕ॳΊͯPerlͱग़ձͬͨ࣌ • Perl3

    ҧ͍͕෼͔ΒΜ • Perl4 Տ໺ઌੜ͕ຊΛग़ͨ͠ • Perl5 զʑͷ஌ͬͯΔPerl
  2. Α͘Θ͔ΔPerl • Perl1.0 —ɹ͋ͬͨΒ͍͠ • Perl2 - Տ໺ઌੜ͕ॳΊͯPerlͱग़ձͬͨ࣌ • Perl3

    ҧ͍͕෼͔ΒΜ • Perl4 Տ໺ઌੜ͕ຊΛग़ͨ͠ • Perl5 զʑͷ஌ͬͯΔPerl Perl1
  3. Α͘Θ͔ΔPerl • Perl1.0 —ɹ͋ͬͨΒ͍͠ • Perl2 - Տ໺ઌੜ͕ॳΊͯPerlͱग़ձͬͨ࣌ • Perl3

    ҧ͍͕෼͔ΒΜ • Perl4 ͋ͬͨΒ͍͠ • Perl5 զʑͷ஌ͬͯΔPerl ΋͸΍ ਆ࿩
  4. αϒϧʔνϯ΋͋Δͧ!! sub MAX { $max = pop(@_); while ($foo =

    pop(@_)) { $max = $foo if $max < $foo; } $max; } ... $bestday = do MAX($mon,$tue,$wed,$thu,$fri);
  5. 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"; }
  6. ͦΕͬΆ͘ #!/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";
  7. ਖ਼ղྫ #!/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";
  8. • .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"; }