Удалить 'tex/task.pl'

This commit is contained in:
Морозов Андрей 2021-12-29 09:37:54 +00:00
parent 34f612970b
commit 07ba24ee83
1 changed files with 0 additions and 41 deletions

View File

@ -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 (<FH>){
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";
}
}
}