CGI

CGI.pmのサンプル。

http://examples.oreilly.com/cgi2/のch05の辺り。 たぶんISBN:4873110440んだけど、よくわからん。 http://www.oreilly.com/catalog/cgi2/index.html

http://hoohoo.ncsa.uiuc.edu/cgi/env.html 必ず。 SERVER_SOFTWARE Format: name/version SERVER_NAME サーバーのホストネームだかIPアドレスだか。 GATEWAY_INTERFACE CGI/1.1 The following environment variables are specific to the request being ful…

CGIをテストする2。

http://d.hatena.ne.jp/kou21058/20050615/p2からちょっと進化。POSTに対応。少しはマシになった、気がする。 ところで、これじゃ画像が見れないじゃん。 #! /usr/bin/perl use strict; use warnings; use IPC::Open2; use Socket; my $script = $0 . ".cgi"…

CGIをテストする。

Apache*1入れればいいんだろうけど、めんどい*2ので、作ってみた。http://localhost:12345/で試せる。ただし全部GET*3。あと、多分CGI.pm使ってないとダメ。 とりあえず、今作ってるのは、これで大丈夫だから、まぁいっか、とか。 #! /usr/bin/perl use stri…

モジュール一覧。

他に方法ないのかなぁ。とりあえず、@INCの下を探して.pmを取って表示。一応CGI*1。 #! /usr/bin/perl use strict; use warnings; print "content-type: text/plain\n\n"; my @modules; &dir( "$_/", "" ) for @INC; sub dir{ my( $inc, $dir ) = @_; my $dh…

#!/usr/local/bin/perl print "content-type: text/plain\n\n"; print `pwd`;cgiが置いてあるディレクトリのフルパスの表示。 cgiのフルパスではない。 この情報は環境変数からもいただけるんだっけか。(調べる気なし)