- 108 名前:106 [2007/04/18(水) 01:17:05 ID:2fOrfnuV]
- #ディレクトリを開く
print "変換するフォルダのパスを入力してください\n"; $folder_path = <STDIN>; chomp($folder_path); #改行コード削除 opendir(DIR, "$folder_path"); @file = readdir(DIR); closedir(DIR); #ファイル名を調べる foreach (@file) { #htmlファイルなら処理 if( $_ =~ /([A-Za-z0-9_]*\.html)/ ){ print (STDOUT "$1"); #ファイルを開く if( !open(F, "+< $floder_path.$1" ) ){ printf(STDOUT "HTML読み込み失敗\n"); } #ファイル1行読み込む while($line = <F>){ print(STDOUT "変換\n"); #iso-8859-1をShift_JISに変換 if( $line =~ s/charset=iso-8859-1/charset=Shift_JIS/ ){ print(F "$line"); } } close(F); } } としたところ、 ファイル名 HTML読み込み失敗 と表示されます。
|

|