Perlコーディング初心者質問スレ Part 40
■ このスレッドは過去ログ倉庫に格納されています
0258251
05/02/09 14:43:07ID:???実際に動かしているコード
#!/usr/bin/perl
use strict "vars";
use strict "subs";
use CGI;
print "Content-type: text/html; charset=euc-jp\n\n";
our $fh;
our %columns;
&hozon();
sub hozon() {
my $query = new CGI;
$columns{upload_file} = $query->param('upload_file');
$fh = $query->upload('upload_file');
print "$fh<BR>";
while(<$fh>) {
print "$_<BR>";
}
}
やっぱりこれで、ブラウザに表示されないですね。
$fhにはC:\Documents and Settings\hogehoge\デスクトップ\新規テキスト ドキュメント.txtと出力されます。
$fh = $query->upload('upload_file'); を my $fh = $query->upload('upload_file'); にして
our $fh; を #our $fh;
にするとすべてブラウザに出力されますね。
リファレンスとか絡んでるんだろうか?
■ このスレッドは過去ログ倉庫に格納されています