Kent Webã®ASKA BBSãMojoliciousã使ã£ãå®è£ ã«ç§»æ¤ãã¾ããã
Kent Webã®ASKA BBSãMojoliciousã使ã£ãå®è£ ã«ç§»æ¤ãã¾ããã
ããã¨ãã¨ã®ASKA BBSã®ãã¼ã¸ã¨ãµã³ãã«ã¯ãã¡ãã§ãã
ãããã°ã©ã ã®å©ç¨è¦å®ã§ããKent Webã®ãã®ãå¼ãç¶ãã§ãã¾ãã
ã移æ¤çã®ASKA BBSã¯ä»¥ä¸ã®ãããªç¹å¾´ãããã¾ãã
ç¹å¾´
ãç¹å¾´ã¯ä»¥ä¸ã®ããã«ãªã£ã¦ãã¾ãã
- Webãã¬ã¼ã ã¯ã¼ã¯Mojoliciousã使ã£ãæ²ç¤ºæ¿ã®å®è£
- cpanmãå é¨çã«ã¯å©ç¨ãããã¯ã³ã³ãã³ãã§ãã»ããã¢ãããå®äº
- Perl 5.10.1以ä¸ã§ãããã¨ã ããè¦ä»¶ã
- CGIã¨çµã¿è¾¼ã¿ã®Webãµã¼ãã¼ã§å®è¡ãå¯è½ããã¨ãã°ããããã®ã¬ã³ã¿ã«ãµã¼ãã¼ã»ã¹ã¿ã³ãã¼ãã§åãããã¨ãã§ãã¾ãã
ãå
é¨å®è£
ã®å
·ä½çãªæ¹åã¯ä»¥ä¸ã®ã¨ããã§ãã
- Webãã¬ã¼ã ã¯ã¼ã¯ã¨ãã¦Mojoliciousãå©ç¨ã
- HTTPãªã¯ã¨ã¹ã®è§£æããã©ã¼ã¡ã¼ã¿ã®åãåããã¯ããã¼ã®åå¾å¦ç
- URLã®ã«ã¼ãã£ã³ã°ã®æ¹åããã³ãã¬ã¼ãã®è¨è¿°ãæ¹åãããããããã¿ãé¨åã«
- ã°ãã¼ãã«ãªãã¡ã¤ã«ãã³ãã«ã¯å©ç¨ããã«ãã¬ãã·ã«ã«å¤æ°ã使ç¨
- å¿ è¦ã¢ã¸ã¥ã¼ã«ã®ã¤ã³ã¹ãã¼ã«ã®ã·ã¹ãã ã¨ãã¦cpanmã使ç¨
- Emailã®éä¿¡ã«MIME::Liteã使ç¨ãã¦ç°¡æ½ã«ãã
- ãã¼ã¸éãã®å¦çã«Data::Pageã¨Data::Page::Navigationãå©ç¨ãã¦ç°¡æ½ã«ããã
- æåã³ã¼ãã®ã¨ã³ã³ã¼ãã«ã¯Encodeã¢ã¸ã¥ã¼ã«ã使ç¨ãJCodeã®ä½¿ç¨ããªãããã
- ãã¼ã¿ä¿åã®ã¨ãã®ã¨ã³ã³ã¼ãå¦çã®ãã¸ãã¯ãå ±éåãã¦æ¹å
- CGIã«å ãã¦çµã¿è¾¼ã¿Webãµã¼ãã¼ã§èµ·åãã§ããã®ã§ãé常ã«é«éã§ã¹ã±ã¼ã©ããªãã£ãããã
- éçºãµã¼ãã¼ãå©ç¨ã§ããã®ã§ãéçºãé常ã«æ¥½ã«ãªã£ãã
ç®ç
ããã®ããã¸ã§ã¯ãã®ç®çã¯ãå¤ãããPerl/CGIããç¾ä»£çãªè¨è¿°ã§ãè¨è¿°ããªãããã¨ã§ããã¬ã³ã¿ã«ãµã¼ãã¼ã§ãç°¡åã«åãããã¨ãã§ããå®æãããWebã¢ããªã±ã¼ã·ã§ã³ããç¾ä»£çãªè¨è¿°ãããã¨ã§ãã
ãã²ã¨ã¤ã®ãµã³ãã«ã示ããã¨ã«ãã£ã¦ãããããææ¬ã«ãã¦æ¸ãç´ããã¨ã§ãç¾ä»£çãªPerlã®è¨è¿°ãè¦ãããã¨ãã§ãã¾ããå¤ãããPerlã®è¨è¿°ã¨æ¯è¼ãããã¨ã§ãã©ã®ãããªé¨åããç°¡æ½ã§æ¹åãããã®ããç解ãããã¨ãã§ããã§ãããã
æ¹åç¹ã®è©³ç´°
ããã®ããã¸ã§ã¯ãã«ãããããã¤ãã®æ¹åç¹ããããå°ã説æãã¦ããã¾ãã
ã¹ã±ã¼ã©ããªãã£
ãã¾ãCGIã®æ大ã®åé¡ç¹ã¨ãã¦ãã¹ã±ã¼ã©ããªãã£ããªããã¨ãããããã¾ããCGIã¯ãæ¯åããã»ã¹ãèµ·åããã®ã§ãããç¨åº¦ã®ã¢ã¯ã»ã¹æ°ãå¢ãã¦ããã¨ããã§ãããã©ã¼ãã³ã¹ãããã¯ã«ãªã£ã¦ãã¾ãã
ãMojoliciousã使ã£ããä»åã®å®è£ ã«ããã¦ã¯ãCGIã§å©ç¨ã§ãã¾ãããããã©ã¼ãã³ã¹ããã¯ãããç¾ãã¦ãããªãã°ãçµã¿è¾¼ã¿ãµã¼ãã¼ãPlack/PSGI対å¿ãµã¼ãã¼ã使ã£ã¦ãã¹ã±ã¼ã«ã¢ãããããã¨ãã§ãã¾ãã
ãããã¯ãPHPã®å©ç¹ã«ããã«ã¦ãã¾ããã¾ãæåã¯ãPHP/CGIã§è¨ç½®ããã®ã§ãããããããã©ã¼ãã³ã¹ããã¯ãããããããªãã°ãmod_phpã使ã£ã¦ãåããã°ã¹ã±ã¼ã«ã¢ãããããã¨ãã§ãã¾ãã
ãCGIã®æ¬ ç¹ã¯ãããç°¡åã«ã¯ãã¹ã±ã¼ãã¢ããã§ããªãã®ã§ãããä»åæ¹è¯ãããCGIã«ããã¦ã¯ãã¹ã±ã¼ãã¢ãããè¡ããã¨ãã§ãã¾ãã
CPANã®å©ç¨
ãCPANã¯Perlã¨ã¯ãã£ã¦ãåãé¢ããªãåå¨ã§ããPerlã®ã©ã¤ãã©ãªã®å®åº«ã§ããCPANã¨ããåå¨ãå©ç¨ã§ãããã¨ããPerlã®å¤§ããªå©ç¹ã®ã²ã¨ã¤ã§ãã
ãCGIã¢ããªã±ã¼ã·ã§ã³ã«ããã¦ããCPANãç°¡åã«å©ç¨ã§ããããã©ããªã«ãããããã¨ã§ãããã
ãç¾ä»£çãªPerlã«ããã¦ã¯ãcpanmã¨ãããã¼ã«ã¨cpanfileã¨ããè¨å®ãã¡ã¤ã«ãå©ç¨ãããã¨ã§ãCPANã«ããã¢ã¸ã¥ã¼ã«ãç°¡åã«å©ç¨ãããã¨ãã§ããã®ã§ãã
ãcpanfileã®ä¸ã«ã¯ãã¢ã¸ã¥ã¼ã«ã®ä¸è¦§ãè¨è¿°ãã¦ãã¾ããããã¦ããããã®ã¢ã¸ã¥ã¼ã«ãcpanmã¨ãããã¼ã«ã使ã£ã¦ãããã¸ã§ã¯ãã®ãã£ã¬ã¯ããªä»¥ä¸ã«ç°¡åã«ã¤ã³ã¹ãã¼ã«ãããã¨ãã§ãã¾ãã
ããã®ããã¸ã§ã¯ãã§ã¯ããã¨ãã°ãMIME::Liteã使ã£ã¦ãã¡ã¼ã«éä¿¡ã®è¨è¿°ãç°¡ç¥ã«ããããData::Pageã¨ããã¢ã¸ã¥ã¼ã«ã使ã£ã¦ããã¼ã¸éãã®è¨è¿°ãç°¡æ½ã«è¨è¿°ãã¦ãã¾ãã
æåã³ã¼ããUTF-8ãå©ç¨ããã¢ã¸ã¥ã¼ã«ãEncodeã«
ãå¤ãããPerlã®æ代ã¯ãã¾ã UTF-8ãåå¨ãã¦ãã¾ããã§ãããããæåã³ã¼ãã¨ããã°ãEUC-jpãShift_JISã§ããã¾ããã
ãããã¦ãæåã³ã¼ãã®å¤æå¦çã¨ããã°ãJcodeã§ããã
ãããã©ããç¾ä»£çãªPerlã®è¨è¿°ã«ããã¦ã¯ãæåã³ã¼ãã¯UTF-8ããæåã³ã¼ãã®æ±ãã«ã¯ãEncodeã¢ã¸ã¥ã¼ã«ã使ãã®ãããã£ã¨ãããã§ãã
ããããããã¨ã§ãæååãçµ±ä¸çã«æ±ããã¨ãã§ãã¾ãããæ£è¦è¡¨ç¾ãå®å ¨ã«æ£ããåãã¾ãã
ã«ã¼ãã£ã³ã°ã¨ãã³ãã¬ã¼ããWebãã¬ã¼ã ã¯ã¼ã¯ã§
ãã«ã¼ãã£ã³ã°ã¨ãã³ãã¬ã¼ãã¯Mojoliciousã¨ããWebãã¬ã¼ã ã¯ã¼ã¯ã§è¡ã£ã¦ãã¾ãã
ãå¤ãããæ代ã®Perlã«ããã¦ã¯ãã«ã¼ãã£ã³ã°ã¨ãã³ãã¬ã¼ãã¯ãã³ã¼ãã«ãã¹ãæ¸ãã¨ãããã¨ãå°ãªãããã¾ãããé常ã«è¨è¿°ããè¤éãªãã®ã«ãªã£ã¦ãã¾ããã
ãã«ã¼ãã£ã³ã°ã¨ãã³ãã¬ã¼ããWebãã¬ã¼ã ã¯ã¼ã¯ã®ãã®ãå©ç¨ãããã¨ã§ãè¨è¿°ãç°¡æ½ã«ãªã£ã¦ãã¾ãã
ãPHPã®å©ç¹ã¯ãHTMLã®ä¸ã«PHPã®è¨è¿°ãããããã¨ã§ãããMojoliciousã®ãã³ãã¬ã¼ããå©ç¨ããã°ãHTMLã®ä¸ã«Perlã®è¨è¿°ãè¡ããã¨ãã§ãã¾ãã
ããã²ã³ã¼ããèªãã§ãå¤ãããPerlã¨ãç¾ä»£çãªPerlã®å·®ã«ã¤ãã¦ãå¦ãã§ã¿ã¦ãã ããã