2009-12-01ãã1ã¶æéã®è¨äºä¸è¦§
ãTestãã¯ããã¦ã¿ã1 - Perlæ¥è¨ã ãTestãã¯ããã¦ã¿ã2 - Perlæ¥è¨ãã®ç¶ãã ããªã£ããµãããªãã¸ã§ã¯ã(ã¢ãã¯)ã使ã£ã¦Test Test::MockObject mock...模é åãã¾ããç©ã ã·ã¹ãã ã®ä¸é¨ã®ãã¹ããªãã ãã©ãã·ã¹ãã ã®ä»ã®é¨åãéãã¨ããããã£â¦
ååãTestãã¯ããã¦ã¿ã1 - Perlæ¥è¨ãã®ç¶ãã Test::Moreçã«ã¤ãã¦ç®æ¡æ¸ãã ãªãã¸ã§ã¯ãæåã®ãã¹ã isa_ok() # 第ä¸å¼æ°ã®objã第äºå¼æ°ã®æå±ã¯ã©ã¹ãªãok, éããªãnot ok ç¶æ¿ãok can_ok() # 第ä¸å¼æ°ã®objã第äºå¼æ°ã®ã¡ã½ãããå¼ã³åºãããªâ¦
ä»ã¾ã§åèæ¸ãªãããèªãã§ãTestã«é¢ããç®æã«é¢ãã¦ã¯é£ã°ãã¦ããã®ã§ãä»æ¥èªãã§ã¿ã¦åãã£ããã¨ã¡ã¢ã å ·ä½çã«ã¯ãç¶ã»åãã¦ã®Perlã17ç« åºæ¬çãªãã¹ãã18ç« é«åº¦ãªãã¹ãã 17.1 ãã¹ãããã°ããã»ã©ã³ã¼ãã¯ãããªã ã§ãããã¼ã åãã£ã¦â¦
WEB+DB PRESSã®ããã¯ãã³ãã¼ãå¹¾ã¤ãè²·ã£ã¦èªãã§ããåããæ°ã«ãªã£ã¦ãmemcachedã®è¨äºãè¼ã£ã¦ãã®ã§èªåã§ããã£ã¦ã¿ããã®è¨é²ã 以ä¸ã¯ãã®memcachedã¤ã³ã¹ãã¼ã«ã¾ã§ã
memcachedãã£ã¦ã¿ã1 - Perlæ¥è¨ã®ç¶ãã ãããPerlã§æ¥ç¶ãã¦ã¿ãã
åææ¥ãä¼ã¿ã ã¨å¿ã«ä½è£ãã§ãããªãã WEB+DB PRESSãåãã¦è²·ã£ã¦èªãã§ããCatalystã¨Moose使ã£ã¦ãã³ã¼ããè¼ã£ã¦ã¦èªåã§ããã£ã¦ã¿ãããªã£ãã®ã§ãã£ã¦ã¿ãã®ã§ãã®è¨é²ã ã¨ããããCatalystãèªåã®Macã«å ¥ãã¦ãé©å½ã«éå½¢ãä½ãã % mkdir cataâ¦
åæ ¼ããã
以åãprint()ã®ãªã¼ãã¼ã©ã¤ããã§ããªãã¨æ¸ããéãid:tokuhiromããã¨id:gfxããããPL_checkãã使ãã¨ã¯ã¦ãã§æ¸ããã¦ãã¦ããï¼ãç¶æ ã ã£ãåã§ãã ãã®åèªã§æ¤ç´¢ãããä¸çªä¸ã«PL_check hack - daily dayflowerãè¦ã¤ãã£ã¦ãããXSãããã¨ã â¦
map()ã«ã¤ãã¦å°ãã¯ã¾ã£ãã®ã§ã¡ã¢ã AI_1 UEO_1 AI_2 UEO_2 AI_3 UEO_3..... ä¸è¨ã®ãããªè¦ç´ ãå ¥ã£ãé åãä½æãããã ã§ãåãã¯ä»¥ä¸ã®ããã«èããã my @array = map { "AI_$_", "UEO_$_" } 1 .. 10; print "@array\n"; ãããããã§ã¯syntax errorâ¦
ãè¸ãå¼µããèçã伸ã°ããèªåãèªããæµã«å¼ãã俯ããªï¼ 諦ãããªè¦éããªã¦ããã§åæã«çµãããããªï¼ åæ ããã¦ã¼ããã¬ãã©ãï¼ åªã³ããªæ°æã¡æªãæãã¦ãããªãåç©ãã¦ãã¼ãï¼ èªå·±é¶é ã«ä»äººãå·»ãè¾¼ããªãæ©ã¿ãããåæã«æ©ãã§ããç¸è«ãâ¦
ããï¼ãã¨æã£ããã¨ããã£ãã®ã§ã¡ã¢ã ããå¤æ°ããµãã«ã¼ãã³ããå¤å´ã§ãµãã«ã¼ãã³ãããåã«å®£è¨ãã¦å¤ãå ¥ãã¦ãã¦ããµãã«ã¼ãã³ã¯ãã®å¤æ°ãåç §ãã¦ãã¦ãããããã®å¤æ°ãããåã«ãµãã¼ã«ã¼ãã³ãå¼ã³åºãã¨ããµãã«ã¼ãã³å ã§å¤ãåç §ã§ããªãâ¦
ããå æ¸ä»¥ä¸ã®ãããªã¨ãããè¦ãã«èããªããªã£ãã®ã§ã $trgt; ........ # ä½ãå¦ç if ($trgt ne "") { EXPR; } ãã®ã¾ã¾use warningsããã¨(ããã¦ãªãã£ãã®ã§)ã$trgtã«å¤ãå ¥ã£ã¦ããªãå ´åã以ä¸ã®è¦åãåºãã #=> Use of uninitialized value in â¦
ãã¾ãæã«æ¸ãããPerlã®CGIãæ¸ãç´ãä¸ã use strict; use warnings; ããã¦ããªãã®ããã¡ãããmy()ããã¦ãªãããã°ãã¼ãã«å¤æ°ã«å¤å ¥ãã¦ãµãã«ã¼ãã³çµãã£ã¦ããã¨ãã500è¡è¿ããµãã«ã¼ãã³ã¨ãã訳ãåãããªãå¤æ°åã¨ãã使ã£ã¦ãªãå¤æ°ãåé â¦
ãã¤ã¾ãã ãªãããã¯å¤©æã£ã¦ã®ã¯ä½ã§ãããããã¦ä½ã§ãªãã®ãã£ã¦åé¡ãªãã ããç¡è½ã ã£ããããã¯ãã£ã¡ã®æ¹ããããã ãã¨ãã§ããªãéæã ã£ããªããçãã¦ããçç±ãããããèããªãã»ã©ã«ãçãã¦ããæå³ãããããèããªãã»ã©ã«ãçãã¦ãã価â¦
ã¡ãã£ã¨ããWebã¯ãã¼ã©ãä½ããã¨æã£ã¦ãHTTP::Requestã使ã£ããã ãã©ããã®ã¨ãç¥ã£ãã¡ã¢ã ãã¤ãã¯ãããã use LWP::UserAgent; my $ua = LWP::UserAgent->new(); my $rq = HTTP::Request->new(GET=>'http://hogehoge.com/index.html'); $ua->requâ¦
id:gfxããããæãã¦ããã ãã¾ããã Re: CORE::ãCORE::GLOBALãåããªãï¼ - Islands in the byte stream CORE::ã使ããã¨CORE::GLOBALã使ããã¨ãªã¼ãã¼ã©ã¤ãã§ããçµã¿è¾¼ã¿é¢æ°ã¨ã§ããªãçµã¿è¾¼ã¿é¢æ°ãããããã§ãã èªåã§è¨å®ã§ããªããããªãâ¦
ãå®ç¨Perlããã°ã©ãã³ã°ãã®ä¸ã«ãã£ãCORE::ãCORE::GLOBALããã¾ãåããªãã£ãã®ã§ã¡ã¢ã ãªãã ãããããã CORE:: CORE::ã¯å¸¸ã«çµã¿è¾¼ã¿é¢æ°ãåç §ãã¾ãã CORE::ã§print()ãµãã«ã¼ãã³ãæ¸ãç´ãã package MyPrint; use strict; use base qw(Expoâ¦
Perlãåå¼·ããã¨ãã«è¦ãããµãã«ã¼ãã³ã®å¼ã³åºãæ¹ã¯ããµãã«ã¼ãã³åã®åã«å¿ ãã¢ã³ããµã³ã(ã&ã)ãã¤ãããã¨ãããã®ã ã£ãã ãããããåãã¦ã®Perlããèªã¿ããPerlãã¹ããã©ã¯ãã£ã¹ããèªã¿ãã§ãã£ã¨ãã®æå³ãåãã£ã(ã¨æã)ã®ã§ã¡ã¢ã ãâ¦
ã¿ã¤ãã«ãã®ã¾ã¾ã ãã¾ãã¾ perldoc perlop ãã¦ããããåãã¦è¦ããããªãã¨ãæ¸ãã¦ãã£ãã®ã§ã¡ã¢ã ä¾ãã°1ã10ã¾ã§å ¥ã£ã¦ããé åã®ä¸èº«ãå ¨é¨ãSãã«å ¥ããªããã my @one_ten = 1 .. 10; foreach foreach my $int (@one_ten) { $int = 'S'; } å¾æ¹â¦
ããããããçãã¦ãããã¨ã®æ¹ãç°å¸¸ãªãã§ããåå£ã¯å¾®ç¬ãã ããæ»ãã§ãããã¨ãæ¬æ¥ã§ãçãã¦ããã¨ããã®ã¯ãããã§ããâ¦â¦ãæ©æ¢°ãæ éãã¦ãããããªç¶æ ãçå½ãªãã¦ãã°ã§ããã®ããããã°ï¼ ã³ã³ãã¥ã¼ã¿ã®ãã°ã§ããï¼ãçå·ã¯ä¸ç¬ã«ãã¦å½¼å¥³ã®â¦
Perlã§ãã¡ã¤ã«ããã¦ã³ãã¼ãããæ¹æ³ã調ã¹ã¦ãããã ç°å¢å¤æ°$ENV{PATH_INFO}ã使ç¨ããããæ¹ãè¦ã¤ããã®ã§ã¡ã¢ã $ENV{PATH_INFO} ã¾ã次ã®CGIãä½ãã #!/usr/bin/env perl # down.cgi print "Content-type: text/html\n\n"; print $ENV{PATH_INFO};â¦
人å ãã ã£ãããèãã®éãã å«ãããããã 㪠ãã ãã¡ããã ãã ã ãæ§ããã ãã¨ããç§ã¯ 人ãã好ããããã¨ã¯ æã£ã¦ããã ç§ã人ã 好ãã§ããã° ããã§ããã â¦â¦â¦â¦â¦â¦ã ä¸ç¬æ ¼å¥½ããå°è©ãã¨ããã£ãããããèªãã§ã¿ã㨠ãã®å°è©ã¯ãã ã®ã¨â¦