Удалить 'tex/task.pl'
This commit is contained in:
parent
34f612970b
commit
07ba24ee83
41
tex/task.pl
41
tex/task.pl
|
@ -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";
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue