2011-07-19から1日間の記事一覧

javascriptのハッシュについて考える。

var hoge = { key : value }; alert(hoge.key); とするとvalueが表示されるわけです。 var hoge = { 'key' : value }; alert(hoge.key); としても同様。 var key = "hash_key" var hoge = { key : value }; alert(hoge.key); としても同様でどうやったらハッ…

HTTP::WebTestでRefererを設定する方法

Refererで弾くページのテストが出来ないので設定がいる。 http_headers = ( Accept => text/plain, text/html ) らしいのでコード的には http_headers => { Referer => 'http://www.google.co.jp' } こうで動くかな? http_headers => ['Referer','http://ho…

SQL::Abstract使って列を取得する方法

よく忘れて毎回調べるので備忘録。 eval{ my $table = 't_user'; my $sql = SQL::Abstract->new(); my ($stmt , @bind) = $sql->select($table ,['id'], \%params); my $sth = $c->dbh->prepare($stmt); $sth->execute(@bind); my $id = $sth->fetchrow_arra…

ApacheでPlackアプリを動かす

loadModule perl_module modules/mod_perl.so <Location /plack_app> SetHandler perl-script PerlHandler Plack::Handler::Apache2 PerlSetVar psgi_app plack_app_dir </Location>