Perl
ã2011-10-01 00:00:00ãã®ä¸ã¶æåã®Time::Pieceãªãã¸ã§ã¯ããåå¾ãããã¨ãããããªå ´åã«ã$t -= ONE_MONTHãã¿ãããªã³ã¼ããæ¸ãããæå³ããªãçµæã«ãªã£ã¦ãã¾ã£ãã詳ããã¯http://blog.clouder.jp/archives/000409.htmlã«æ¸ãã¦ããéãã以ä¸ã¯â¦
AnyEvent::JSONRPC::Liteããè¦ç¹ãæãåºãããµã¼ãå é¨ã®condvarãrecvãã¦ããç®æã ãµã¼ãå´ use strict; use warnings; use AnyEvent; use AnyEvent::Handle; use AnyEvent::Socket; use Data::Dumper; tcp_server '127.0.0.1', 8888, sub { my ($fh) â¦
AnyEvent::Handleã®æ±ãã«è¦å´ããã ioãtimerã®ã²ãã£ã¼å¤æ°ã®ããã«undefã§ãè¡ãããåç §ã«ã¦ã³ããæ®ã£ã¦ããã¨ã©ãããããªãã®ãããããAnyEvent::JSONRPC::Liteã§ãweaken $handleã¨ãã£ã¦ããé¨åãã©ããä»ã²ã¨ã¤ç解ã§ããã«ããã®ã ãã大äºã â¦
ããããã¨æ¸ãæ¹ãããï¼ã®ã§è¦å´ããã$handle->destroyããã¨ãããã¨ã¯ã½ã±ããæ¥ç¶ãåãã¨ãããã¨ã§ãããã®ã§ãã©ã®æç¹ã§ããã®ãããã¡ãã¨éä¿¡ãé ã®ä¸ã«æãæµ®ãã¹ãªãã¨ãããªãã ãµã¼ãå´ use strict; use warnings; use AnyEvent; use AnyEvâ¦
AnyEvent::HandleãAnyEvent::Socketã使ããä»åã¯telnetã使ããªãã§tcp_connectã使ã£ã¦ã¿ãã ãµã¼ãå´ãã¨ã³ã¼ããã¯ããæã«æ¹è¡æåãå ¥ããªãã¨ãããããã¯ãã¦ãã¾ãé¨åã§ã¯ã¾ã£ããlineå½¢å¼ã®ãã¼ã¿ã®ããåãã§ã¯æ¹è¡ãå¿ é ãªã®ããªã ãµã¼ãå´â¦
AnyEvent::Handleã使ã£ã¦å¯¾è©±ãããµã¼ããæ¸ã ãµã¼ããç«ã¡ä¸ãã¦telnetã§ã¢ã¯ã»ã¹ããã¨ååãèãããã®ã§çããã次ã«å¹´é½¢ã¾ã§èãã¦ããã®ã§çãã¾ããããã§å¯¾è©±ãçµäºããµã¼ãã®æ¹ããæ¥ç¶ãåã£ã¦ãã¾ããå³åã¯IOç£è¦ã®ä¸ã§ããã«ç£è¦ããã¦ããã¨â¦
æè¿ä½ãæ¸ãã¦ããªãã£ãã®ã§AnyEventã®å¾©ç¿ã§ãè¶ãæ¿ãã AnyEvent::Introã«ãè¼ã£ã¦ãããµã³ãã«ã æ®éã«æ¨æºå ¥åããã®å ¥åãå¾ ã¡åããã¹ã¯ãªããã¨ã©ãéãã®ï¼ã¨ãããããªçåãæã£ã¦ãã¾ããµã³ãã«ã use strict; use warnings; use AnyEvent; uâ¦
JSONRPCãµã¼ããç«ã¦ã¦ã¯ã©ã¤ã¢ã³ãããã®ãªã¯ã¨ã¹ããéåæã§è¿ãããã¨ããèª²é¡ ãµã¼ãã®ã¹ã¯ãªããã¯ä»¥ä¸ã®éãã use strict; use warnings; use AnyEvent::JSONRPC::Lite; use Data::Dumper; my $cv = AE::cv; my $server = AnyEvent::JSONRPC::Lite::â¦
ãã¥ã¼ã®ç解ã¨ããã¤ãã³ãã«ã¼ãã®ç解ã¨ãã¾ã ã¾ã æµ ãã®ãæ¥æ¬èªã«ãåºã¦ãã¾ã£ã¦ããããããã¾ããããä¸å©ã¨ãªãã°å¹¸ãã§ãã誤訳ã¯ããã¨æãã®ã§ãå ã®ãµã¤ãã確èªãã¦ããææ¸ã®æ´å½¢ã¯ãããããã¦ããã¾ãã http://search.cpan.org/~mlehmann/Aâ¦
Date::Calcã¢ã¸ã¥ã¼ã«ã®Delta_Daysé¢æ°ã使ãã æ®éã®æè¦ãªã2010å¹´ã¯1/1ã12/31ã®ãã¨ã§ã365æ¥ãããã®ã¨æãã ããã°ã©ã ã§ã¯é½åä¸æå¾ã«ã¤ã³ã¯ãªã¡ã³ãããªãã¨ãããªãã use strict; use warnings; use Date::Calc qw/Delta_Days/; my @from = qw/â¦
LWPã¨HTTP::Requestã使ã use strict; use warnings; use LWP; use Data::Dumper; my $ua = LWP::UserAgent->new; my $req = HTTP::Request->new(HEAD => 'http://www.care-service.jp'); my $header = $ua->request($req); #print Dumper $header; print $â¦
ã³ãã³ãã©ã¤ã³ããWEBã¢ã¯ã»ã¹ãããããBasicèªè¨¼ã®ããã£ããã¼ã¸ã®ãã¼ã¿ãåå¾ãããã¨ããæã®ãµã³ãã« use strict; use warnings; use HTTP::Request::Common; use LWP::UserAgent; my $name = "YOURNAME"; my $pass = "YOURPASS"; my $ua = LWP::Useâ¦
æ¬å±ãããã¤ãã¦ããããããã£ãæ¬ãçºè¦ã å½¹ã«ç«ã¤ã¢ã¸ã¥ã¼ã«ãä½ã£ã¦å ¬éãããã¨ããæ°æã¡ã¯å¤ã ããããã¨ããããã¯ãã¢ã¸ã¥ã¼ã«ã使ã人ãããã£ã¨æ·±ãæãä¸ããªããã°ãªããªãããããã!ã¨è¨ããã Plaggerå¾¹åºæ»ç¥è¡posted with amazlet at 09â¦
Web Client Programming With Perl (A Nutshell handbook)posted with amazlet at 09.10.15Clinton Wong Oreilly & Associates Inc 売ãä¸ãã©ã³ãã³ã°: 484519Amazon.co.jp ã§è©³ç´°ãè¦ã
perlpacktut - pack 㨠unpack ã®ãã¥ã¼ããªã¢ã«(æ¥æ¬èª)
è¨èã®æå³ãã¤ãã¤ãææ§ã§ããããæ¸ãã¦ããã¾ããã æåï¼ãã£ã©ã¯ã¿ï¼ãããããåä½ãã®ãã¨ï¼ï¼ æåã¯å¤å°å®ç¾©ãããããã®ã§ããæåã¯ãã©ã¼ãããã«æ¬ ãã¦ããè¨å·ã®æ½è±¡çãªèª¬æã§ããUnicodeã«ã¯LATIN SMALL LETTER A (a, a, a ãªã©) ã¨å¼ã°ãâ¦
DBIã¢ã¸ã¥ã¼ã«ã使ã£ã¦ã¤ã³ãµã¼ãã¯ã¨ãªãçºè¡ãã
æå 10é²æ° 16é²æ° æå 10é²æ° 16é²æ° æå 10é²æ° 16é²æ° a 97 61 b 98 62 c 99 63 d 100 64 e 101 65 f 102 66 g 103 67 h 104 68 i 105 69 j 106 6a k 107 6b l 108 6c m 109 6d n 110 6e o 111 6f p 112 70 q 113 71 r 114 72 s 115 73 t 116 74 u 117â¦
perldocã¾ãããèªã ã¢ã«ãã¡ãããã10é²æ°ã¨16é²æ°ã«å¤æããã ç¨èªã®å®ç¾© packã¨unpack
ãã¾ããã¨Perlãã«æ¸ãã¦ãããã¾ããã¨Encodeãããéå§ Perlã¯å é¨çãªæåã³ã¼ããUTF-8ã§å¦çãã¦ãã ASCIIã¨ä¸ä½äºæãªã®ã¯UTF-8(èªåã§å ·ä½çã«èª¬æãã¦ãã¨è¨ãããã¨ã¯ã«ãªãã»ã³) UTF-8ã§ã¯1æåã«ã¤ã3ãªã¯ããã(ãã¤ã) utf8ãã©ã°ãã¨betesãâ¦
ä¾å¤å¦çã®ä½¿ãæ¹ã¨ãã¤ãã¤ãç解ãã¦ããªãã£ããã©ããã£ã±ã大äºã¨ãããã¨ã«æ°ã¥ããã #!/usr/bin/env perl use strict; use warnings; use JSON; use Data::Dumper; my $json = <<'EOT'; { "foo" : [0,1,2], "bar" : [3,4,5] }, EOT my $obj = ''; evâ¦
use strict; use warnings; { package Database; use strict; use warnings; sub new {die;} sub select_username_from_db_where_mailaddr_equal { my ($class, $mailaddr) = @_; if($mailaddr eq '[email protected]'){ return "Watasi wa kanrinin"; } else {â¦
å帰ã®é¨åã§è¦ãããã·ã¼ã±ã³ã¹å³ãæããã¨ã§(æ¬ã«ãè¼ã£ã¦ãã)æ´ã¿ãããã¯ãªããShallowCopyã¨ã¯ä½ãªã®ãDeepCopyã¨ã¯ä½ãªã®ãã¨ããå°ãç解ã§ãã¦ããªãã¨è¦ããããªãShallowCopyãªã®ããããã¯DeepCopyãªã®ããåã£ã¦ããã°æ¥½ãªã®ã ããããã©ããâ¦
ç解ã®è¶³ããªãé¨åãè¦ãã¦ããããã©ãå ã«è§23ãã¿ã¼ã³å ¨é¨ãã£ã¦ã¿ãã use strict; use warnings; { package Display; use strict; use warnings; sub getColumns {die;} sub getRows {die;} sub getRowText {die;} sub show { my ($self, ) = @_; for(â¦
mapãgrepããã¾ãã¡ä½¿ãããªãã¦ããªãã£ãããã©å°ãããã£ãæ°ãããã use strict; use warnings; my $date = [ ["2009-02-23", "a"], ["2009-02-23", "b"], ["2009-02-21", "c"], ["2009-02-24", "d"], ["2009-02-23", "e"], ]; ######################â¦
ãã¯ãå帰ã«è¦ææèãããã以åschemeãå°ãããã£ã¦ã¿ãã®ãæãã§ããããããããããã°è¦ææèãæ¶ããã ããã¨æã£ã¦ããã use strict; use warnings; { package Entry; use strict; use warnings; sub add {} sub printList {die;} sub toString â¦
ä¹ ã ã®ã¨ã³ããªãããä¸ã¤ã¯æéã®é½åã§ç§»ãå¤ãããåãstrategyã§åè² ãã¦ãã¾ãã use strict; use warnings; { package Hand; use strict; use warnings; my $GUU = 0; my $CHO = 1; my $PAA = 2; my $hand = [ Hand->new($GUU), Hand->new($CHO), Handâ¦
Strategyãã¿ã¼ã³ãç·´ç¿ãã¦ãã¦åºã¦ããã¸ã£ã³ã±ã³ã¢ã«ã´ãªãºã ãããã¾ãããªããããã°ã©ãã³ã°ã£ã¦ããã®ã¯ãããã£ãã¢ã«ã´ãªãºã ãçã¿åºããã¨ãè¨ããã ãªã¨ãã¾ã ã¾ã ä¿®è¡ã足ãã¾ããã use strict; use warnings; { package Hand; use strict; usâ¦
use strict; use warnings; { package Display; use strict; use warnings; sub new { my ($class, $impl, ) = @_; my $self = { impl => $impl, }; return bless $self, $class; } sub open { $_[0]->{impl}->rawOpen(); } sub print { $_[0]->{impl}->rawPâ¦
use strict; use warnings; { package Director; use strict; use warnings; sub new { my ($class, $builder) = @_; my $self = { builder => $builder, }; return bless $self, $class; } sub construct { my $self = shift; $self->{builder}->makeTitle(â¦