| Ŭ·¡½º :: ÇÁ·ÎÅä ŸÀÔ :: Mixin. Ŭ·¡½º :: ÇÁ·ÎÅä ŸÀÔ :: MIXIN Perl ¸ðµâ¿¡´Â Ŭ·¡½º :: ÇÁ·ÎÅä ŸÀÔÀ»À§ÇÑ ¹Í½º Áö¿øÀÌ Æ÷ÇԵǾî ÀÖ½À´Ï´Ù. |
Áö±Ý ´Ù¿î·Îµå |
Ŭ·¡½º :: ÇÁ·ÎÅä ŸÀÔ :: Mixin. ¼øÀ§ ¹× ¿ä¾à
- ƯÇã:
- Perl Artistic License
- °Ô½ÃÀÚ À̸§:
- Terrence Brannon
- °Ô½ÃÀÚ À¥»çÀÌÆ®:
- http://search.cpan.org/~tbone/
Ŭ·¡½º :: ÇÁ·ÎÅä ŸÀÔ :: Mixin. ű×
Ŭ·¡½º :: ÇÁ·ÎÅä ŸÀÔ :: Mixin. ¼³¸í
Ŭ·¡½º :: ÇÁ·ÎÅä ŸÀÌÇÎ µÈ :: Mixin Perl ¸ðµâ¿¡´Â Ŭ·¡½º :: ÇÁ·ÎÅä ŸÀÌÇÎÀ»À§ÇÑ ¹Í½º Áö¿øÀÌ Æ÷ÇԵǾî ÀÖ½À´Ï´Ù. Ŭ·¡½º :: ÇÁ·ÎÅä ŸÀÔ :: MixIn Perl ¸ðµâÀº Ŭ·¡½º :: ÇÁ·ÎÅä ŸÀÌÇÎÀ»À§ÇÑ ¹Í½º Áö¿øÀ» Æ÷ÇÔÇÕ´Ï´Ù :: ÇÁ·ÎÅä ŸÀÌÇÎ. ½Äº°ÀÚ 1 : Ŭ·¡½º¸¦ äÂïÀ¸·ÎÇÏ°í ½ºÄ®¶ó ÆÐÅ°Áö HelloWorld¿¡¼ ´øÁö½Ê½Ã¿À. Sub Hello {My ($ self, $ ¿¬·É) = @_; ¹Ýȯ "Hello World! ³ª´Â $ Ageiey ill"} ÆÐÅ°Áö HelloWorld :: ´ë¹®ÀÚ; ±âº» QW (Ŭ·¡½º :: ÇÁ·ÎÅä ŸÀÌÇÎ); __package __-> ¹Ý¿µ -> addslot ( => sub {my $ self = shift; my $ ret = $ self-> ¹Ý¿µ -> ½´ÆÛ ( 'hello', @_); UC $ ret} ); HelloWorld ÆÐÅ°Áö :: ´ë´ãÇÑ; ±âº» QW (Ŭ·¡½º :: ÇÁ·ÎÅä ŸÀÌÇÎ); __package __-> ¹Ý¿µ -> addslot ( => sub {my $ self = shift; my $ ret = $ self-> ¹Ý¿µ -> ½´ÆÛ ( 'hello', @_); " $ ret ";}); HelloWorld ÆÐÅ°Áö :: ÀÌÅŸ¯Ã¼; ±âº» QW (Ŭ·¡½º :: ÇÁ·ÎÅä ŸÀÌÇÎ); __package __-> ¹Ý¿µ -> addslot ( => sub {my $ self = shift; my $ ret = $ self-> ¹Ý¿µ -> ½´ÆÛ ( 'hello', @_); " $ ret ";}); # script.pl - ÀÌÁ¦ ÈÖÇÎÀÌ ½ÃÀ۵Ǵ Ŭ·¡½º :: ÇÁ·ÎÅä ŸÀÔ :: Mixin QW (Mixin); MY $ RUNTIME = MIXIN ( 'HelloWorld'=> 'HelloWorld :: ´ë¹®ÀÚ', 'HelloWorld :: Italic'); $ runtime-> ¾È³çÇϼ¼¿ä (74); ¾È³çÇϼ¼¿ä ¼¼°è! ³ª´Â 74 ¼¼ »ç¿ë¹ý 2 : Ŭ·¡½º :: ÇÁ·ÎÅä ŸÀÌÇÎ µÈ ÆÐÅ°Áö ÄÄÆÄÀÏ Æ¼Å¸¿¡ °èÃþ ±¸Á¶¸¦ ¸¸µé°í ¼³Ä¡ÇÕ´Ï´Ù. Ŭ·¡½º :: ÇÁ·ÎÅä ŸÀÌÇÎ µÈ :: MIXIN QW (MIXIN); MY $ UCLASS = MIXIN ( 'HelloWorld'=> 'HelloWorld :: ´ë¹®ÀÚ', 'HelloWorld :: Bold'); __package __-> ¹Ý¿µ -> addslot ( '*'=> $ uclass); # script.pl ÄÄÆÄÀÏ Æ¼¹Ì¸¦ »ç¿ëÇϽʽÿÀ; Àμâ ÄÄÆÄÀÏÅÏ -> ¾È³çÇϼ¼¿ä (88); ¾È³çÇϼ¼¿ä! ³ª´Â 88 ¼¼ ¿ä±¸ »çÇ× : ¡¤ perl
Ŭ·¡½º :: ÇÁ·ÎÅä ŸÀÔ :: Mixin. °ü·Ã ¼ÒÇÁÆ®¿þ¾î