OO language Perl

3,728 views
3,610 views

Published on

オブジェクト指向言語Perl
Kansai.pm meeting #08

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,728
On SlideShare
0
From Embeds
0
Number of Embeds
52
Actions
Shares
0
Downloads
52
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

OO language Perl

  1. 1. id:lapis25 lapis25@gmail.com Kansai.pm Meeting #8/20070310
  2. 2. Larry Wall 070310 Kansai.pm Meeting #8/01-Perl-oo 2
  3. 3. 070310 Kansai.pm Meeting #8/01-Perl-oo 3
  4. 4. • • • 070310 Kansai.pm Meeting #8/01-Perl-oo 5
  5. 5. 070310 Kansai.pm Meeting #8/01-Perl-oo 6
  6. 6. 070310 Kansai.pm Meeting #8/01-Perl-oo 7
  7. 7. 070310 Kansai.pm Meeting #8/01-Perl-oo 8
  8. 8. 070310 Kansai.pm Meeting #8/01-Perl-oo 9
  9. 9. 070310 Kansai.pm Meeting #8/01-Perl-oo 10
  10. 10. package Class; 070310 Kansai.pm Meeting #8/01-Perl-oo 11
  11. 11. 070310 Kansai.pm Meeting #8/01-Perl-oo 12
  12. 12. • • 070310 Kansai.pm Meeting #8/01-Perl-oo 13
  13. 13. package Class; sub method { # } 070310 Kansai.pm Meeting #8/01-Perl-oo 14
  14. 14. $obj_ref->method('args'); Class::method($obj_ref, 'args'); 070310 Kansai.pm Meeting #8/01-Perl-oo 15
  15. 15. package Class; sub method { my ($self, @args) = @_; # } 070310 Kansai.pm Meeting #8/01-Perl-oo 16
  16. 16. 070310 Kansai.pm Meeting #8/01-Perl-oo 17
  17. 17. 070310 Kansai.pm Meeting #8/01-Perl-oo 18
  18. 18. 070310 Kansai.pm Meeting #8/01-Perl-oo 19
  19. 19. bless $hash_ref, 'Class'; • • 070310 Kansai.pm Meeting #8/01-Perl-oo 20
  20. 20. #A bless print ref($hash_ref); $hash_ref #HASH bless $hash_ref, 'Class'; #B bless print ref($hash_ref); Class #Class _id '01' _type 'script' _name 'Perl' 070310 Kansai.pm Meeting #8/01-Perl-oo 21
  21. 21. 070310 Kansai.pm Meeting #8/01-Perl-oo 22
  22. 22. 070310 Kansai.pm Meeting #8/01-Perl-oo 23
  23. 23. 070310 Kansai.pm Meeting #8/01-Perl-oo 24
  24. 24. package Class; sub new { my ($class, @args) = @_; return bless { @args }, $class; } 070310 Kansai.pm Meeting #8/01-Perl-oo 25
  25. 25. $obj_ref = Class->new( $id, $type ); $obj_ref = Class::new('Class',$id, $type); 070310 Kansai.pm Meeting #8/01-Perl-oo 26
  26. 26. • DESTROY • • 070310 Kansai.pm Meeting #8/01-Perl-oo 27
  27. 27. 070310 Kansai.pm Meeting #8/01-Perl-oo 28
  28. 28. • • • • 070310 Kansai.pm Meeting #8/01-Perl-oo 29
  29. 29. 070310 Kansai.pm Meeting #8/01-Perl-oo 30
  30. 30. package PerlHacker; use base qw( Programmer Obfuscator ); package Programmer; use base qw( Coder Documenter ); 070310 Kansai.pm Meeting #8/01-Perl-oo 31
  31. 31. Coder Documenter use base qw( Coder Documenter ); Programmer Obfuscator use base qw( Programmer Obfuscator ); PerlHacker 070310 Kansai.pm Meeting #8/01-Perl-oo 32
  32. 32. Coder Documenter Programmer Obfuscator PerlHacker 070310 Kansai.pm Meeting #8/01-Perl-oo 33
  33. 33. 070310 Kansai.pm Meeting #8/01-Perl-oo 34
  34. 34. 070310 Kansai.pm Meeting #8/01-Perl-oo 35
  35. 35. 070310 Kansai.pm Meeting #8/01-Perl-oo 36
  36. 36. 070310 Kansai.pm Meeting #8/01-Perl-oo 37
  37. 37. 070310 Kansai.pm Meeting #8/01-Perl-oo 38
  38. 38. • • • • • • 070310 Kansai.pm Meeting #8/01-Perl-oo 39
  39. 39. 070310 Kansai.pm Meeting #8/01-Perl-oo 40
  40. 40. 070310 Kansai.pm Meeting #8/01-Perl-oo 41
  41. 41. 070310 Kansai.pm Meeting #8/01-Perl-oo 42
  42. 42. 070310 Kansai.pm Meeting #8/01-Perl-oo 43
  43. 43. • Class::Accessor(::fast) – • Class::Data::Inheritable – 070310 Kansai.pm Meeting #8/01-Perl-oo 44
  44. 44. • NEXT – Catalyst – • Class::C3 – DBIC – C3 NEXT 070310 Kansai.pm Meeting #8/01-Perl-oo 45
  45. 45. Class::Std 070310 Kansai.pm Meeting #8/01-Perl-oo 46
  46. 46. 070310 Kansai.pm Meeting #8/01-Perl-oo 47
  47. 47. • :-( • Perl 070310 Kansai.pm Meeting #8/01-Perl-oo 48
  48. 48. 070310 Kansai.pm Meeting #8/01-Perl-oo 49
  49. 49. 070310 Kansai.pm Meeting #8/01-Perl-oo 50
  50. 50. Perl … • • • • • 070310 Kansai.pm Meeting #8/01-Perl-oo 51
  51. 51. 070310 Kansai.pm Meeting #8/01-Perl-oo 52
  52. 52. 070310 Kansai.pm Meeting #8/01-Perl-oo 53
  53. 53. 070310 Kansai.pm Meeting #8/01-Perl-oo 54

×