| Plack :: ¹Ìµé¿þ¾î :: Scope :: Container. ¿äû ´ç ÄÁÅ×ÀÌ³Ê |
Áö±Ý ´Ù¿î·Îµå |
Plack :: ¹Ìµé¿þ¾î :: Scope :: Container. ¼øÀ§ ¹× ¿ä¾à
- ƯÇã:
- Perl Artistic License
- °Ô½ÃÀÚ À̸§:
- Masahiro Nagano
- °Ô½ÃÀÚ À¥»çÀÌÆ®:
- http://search.cpan.org/~kazeburo/
Plack :: ¹Ìµé¿þ¾î :: Scope :: Container. ű×
Plack :: ¹Ìµé¿þ¾î :: Scope :: Container. ¼³¸í
Plack :: ¹Ìµé¿þ¾î :: Scope :: ÄÁÅ×ÀÌ³Ê ¹× ¹üÀ§ :: ÄÁÅ×À̳ʴ mod_perlÀÇ pnotes¿Í °°ÀÌ ÀÛµ¿ÇÏ´Â Perl ¸ðµâÀÔ´Ï´Ù. ÀÀ¿ë ÇÁ·Î±×·¥¿¡ ¿äûÇÒ ¼öÀÖ´Â ÄÁÅ×À̳ʸ¦ Á¦°øÇÕ´Ï´Ù .Synopsis Plack :: Builder; ºô´õ {enable "Plack :: ¹Ìµé¿þ¾î :: ½ºÄÚÇÁ :: ÄÁÅ×À̳Ê"; $ ¾Û}; ÀÀ¿ë ÇÁ·Î±×·¥ ÆÐÅ°Áö¿¡¼ # myApp; ¹üÀ§ :: ÄÁÅ×À̳ʸ¦ »ç¿ëÇϽʽÿÀ. sub getdb {if (my $ dbh = scope_container ( 'db')) {$ dbh ¹Ýȯ; } else {my $ dbh = dbi-> connect (...); scope_container ( 'db', $ dbh)´Â $ dbh¸¦ ¹ÝȯÇÕ´Ï´Ù. }} ÇÏÀ§ ÀÀ¿ë ÇÁ·Î±×·¥ {My $ env = shift; getdb (); # getDB ()¸¦ ¿¬°áÇϽʽÿÀ. # container getdb ()¿¡¼; # ÄÁÅ×ÀÌ³Ê ¸®ÅÏ ]] # ¿äûÀÇ ³¡¿¡¼ DB¿¡¼ ¿¬°á ²÷±â} Á¦Ç° ȨÆäÀÌÁö
Plack :: ¹Ìµé¿þ¾î :: Scope :: Container. °ü·Ã ¼ÒÇÁÆ®¿þ¾î