#!/usr/local/bin/perl use strict; use warnings; use utf8; #このプログラムは、utf-8で記述されている事を示す。 print "Content-type: text/html; charset=utf-8\n\n"; print "\n"; print "\n"; print "\n"; print "CGI test\n"; print "\n"; print "\n"; print "------------------
\n"; #Shift-JISで書かれたファイルを読み込む open(DATAFILE, "<:encoding(cp932)", "data_shiftjis0.txt") or die("Error:$!"); while(my $line = ){ chomp($line); #末尾の改行文字を削除 print "$line
\n"; } close(DATAFILE); print "------------------
\n"; print "\n"; print "\n";