From 07ba24ee833b827caf131940ecea9452a312424a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=BE=D1=80=D0=BE=D0=B7=D0=BE=D0=B2=20=D0=90=D0=BD?= =?UTF-8?q?=D0=B4=D1=80=D0=B5=D0=B9?= Date: Wed, 29 Dec 2021 09:37:54 +0000 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D0=B8=D1=82=D1=8C=20't?= =?UTF-8?q?ex/task.pl'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tex/task.pl | 41 ----------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 tex/task.pl diff --git a/tex/task.pl b/tex/task.pl deleted file mode 100644 index 069d2c8..0000000 --- a/tex/task.pl +++ /dev/null @@ -1,41 +0,0 @@ -use locale; -use encoding "cp866"; -{ - print "Имя папки: "; my $folder_name=<>; - chomp($folder_name); - my @files = `chcp 866 & attrib $folder_name\\*.pl`; - if (substr($files[1],0,15) eq 'Не найден путь:') { - print "Путь не найден. Попробуйте еще.\n"; - redo; - } - elsif (substr($files[1],0,15) eq 'Не найден файл:') { - print "Папка не содержит файлов .txt .\n"; - last; - } - else { - foreach my $file (@files[1 .. $#files]){ - my $file_name = substr($file, 11); - chomp($file_name); - open(FH,"<$file_name") or die $!; - my %hash = (); - foreach $chunk (){ - my @words = $chunk =~ /([\@\%\$][a-zA-Z_0-9]+[\[\{]?)/g; - foreach my $word (@words) { - $word = "\$".substr($word, 1) - if (substr($word, 0, 1) eq '@' && - substr($word, -1) eq '['); - $word = "\$".substr($word, 1)."[" - if (substr($word, 0, 1) eq '@'); - $word = "\$".substr($word, 1)."{" - if (substr($word, 0, 1) eq '%'); - $hash{$word}++; - }; - }; - my @xs = keys %hash; - print @xs; - close(FH); - my $ans = scalar(@xs); - print "$file_name : $ans\n"; - } - } -} \ No newline at end of file