- 211 名前:デフォルトの名無しさん [2009/09/05(土) 20:43:27 ]
- 以下作ってみたコード
#! /usr/bin/perl use CGI; use IO::File; $logfile = 'data.log'; # ログファイルの名前 $logfile_02 = 'data_02.log'; # ログファイルの名前 $all_data = read_all_data(\$logfile); $all_data_02 = read_all_data(\$logfile_02); $q = new CGI; print $q -> header(-Charset=>'sjis'); print $q -> start_html(-title => "test"); print @$all_data; print @$all_data_02; exit; sub read_all_data{ my $logfile = shift; my $io = IO::File->new($$logfile, 'r'); my @lines = $io->getlines; $io->close; return \@lines; }
|

|