#!/usr/bin/perl ###################################################### # ログ内のhttp://で始まるアドレスにリンクタグを設定 # 07/06/10 ###################################################### $tmp = 'note.tmp'; # テンポラリーファイル @target =('_self','_top','_parent','_blank'); # require './notedat.pl'; # 設定データー if(!open(IN,"$log_dir$log_name")){&err_out("ログ$log_dir$log_nameが読み込めません.\n");} @buffer = ; close(IN) ; if(!open(OUT,">$log_dir$tmp")){&err_out ("テンポラリーファイルが作成できません.");} foreach $line (@buffer) { ($no,$back,$next,$file,$year,$mon,$day,$wday,$subj,$com,$h_pos) = split(/<>/, $line); if($url_f){ # URL自動リンク判別 if($url_str ne 'NULL'){ $com =~ s/(http\:[\w\.\~\-\/\?\&\+\=\:\@\%\;\#]+)/$url_str<\/a>/g ; }else{ $com =~ s/(http\:[\w\.\~\-\/\?\&\+\=\:\@\%\;\#]+)/$1<\/a>/g ; } } $line2 = "$no<>$back<>$next<>$file<>$year<>$mon<>$day<>$wday<>$subj<>$com<>$h_pos"; print OUT "$line2"; } close(OUT); rename("$log_dir$tmp", "$log_dir$log_name") ; # リネーム &err_out ("変換を終了しました\n"); exit; sub err_out{ &head; print "

$_[0]

"; &botm; exit; } sub botm{ print <<_HTML_; _HTML_ } sub head{ print "Content-type: text/html\n\n"; print <<_HTML_; $ver _HTML_ }