#webliberty::Basis.pm (2007/02/27) #Copyright(C) 2002-2007 Knight, All rights reserved. package webliberty::Basis; use strict; ### コンストラクタ sub new { my $class = shift; my $self = { }; bless $self, $class; return $self; } ### ヘッダー sub header { my $self = shift; return "Content-Type: text/html; charset=utf-8\n\n"; } ### エラー出力 sub error { my $self = shift; my $message = shift; print $self->header; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "Error\n"; print "\n"; print "\n"; print "

Error

\n"; print "\n"; print "
Web Liberty
\n"; print "\n"; print "\n"; exit; } ### 実行状態記録 sub trace { my $self = shift; my $message = shift; my $file = shift; if (!$file) { $file = './trace.log'; } open(webliberty_Basis, ">>$file") or $self->error("Write Error : $file"); print webliberty_Basis $message; close(webliberty_Basis); return; } 1;