0
문자열로 파일을 읽으려고 시도하고 각 문자의 유니 코드 범위 2816-2943을 확인하려고합니다. 범위 및 \ n에 해당하는 문자를 제외하고는 다른 모든 문자를 건너 뛸 필요가 있습니다. 나는 그물에서 다음 코드를 가지고 있지만 나를 위해 일하지 않습니다. 나는 어리석은 실수를한다면 미안하다. 나는 펄을 처음 사용한다. plz 오늘 내가 끝내야 할 도움이.perl이 파일을 문자열로 읽어 들인 다음 각 문자의 유니 코드 범위를 확인하십시오.
use utf8;
use encoding 'utf8';
use open qw/:std :utf8/;
binmode(STDOUT, ":utf8"); #makes STDOUT output in UTF-8 instead of ordinary ASCII.
$file="content.txt";
open FILE1, ">filtered.txt" or die $!;
open(FILE, "<$file") or die "Can't read file 'filename' [$!]\n";
binmode(FILE);
my $document = <FILE>;
close (FILE);
print $document;
코드가 작동하지 않는 이유는 단순히 한 파일의 내용을 다른 파일로 복사하기 때문에 필터링이 필요하지 않기 때문입니다. – ThisSuitIsBlackNot