version 1.1, 2001/10/31 03:00:07
|
version 1.2, 2001/10/31 03:07:18
|
Line 1
|
Line 1
|
package chgkfiles;
|
#!/usr/bin/perl |
use DBI;
|
package chgkfiles; |
use Exporter;
|
use DBI; |
use vars qw(@ISA @EXPORT);
|
use Exporter; |
@ISA=qw(Exporter);
|
use vars qw(@ISA @EXPORT); |
|
@ISA=qw(Exporter); |
@EXPORT = qw(&input_files &output_files &mywrite &auto_message
|
|
&myprint &config_error &getstring);
|
@EXPORT = qw(&input_files &output_files &mywrite &auto_message |
|
&myprint &config_error &getstring); |
|
|
BEGIN {do "chgk.cnf"};
|
|
|
BEGIN {do "chgk.cnf"}; |
my %prt;
|
|
|
my %prt; |
sub auto_message
|
|
{
|
sub auto_message |
my $time=localtime;
|
{ |
my $f=$_[0];
|
my $time=localtime; |
|
my $f=$_[0]; |
print $f "# This file is automatically generated at $time by $_[1]\n";
|
|
}
|
print $f "# This file is automatically generated at $time by $_[1]\n"; |
|
} |
sub mywrite
|
|
{
|
sub mywrite |
(my $file, %prt)=@_;
|
{ |
write $file;
|
(my $file, %prt)=@_; |
}
|
write $file; |
|
} |
sub myprint
|
|
{
|
sub myprint |
(my $file, @prt)=@_;
|
{ |
print $file @prt;
|
(my $file, @prt)=@_; |
}
|
print $file @prt; |
|
} |
sub setcount
|
|
{
|
sub setcount |
$c=shift
|
{ |
}
|
$c=shift |
|
} |
sub setword
|
|
{
|
sub setword |
$word=shift
|
{ |
}
|
$word=shift |
|
} |
|
|
sub getstring #берёт первую
|
|
{
|
sub getstring #берёт первую |
|
{ |
if ($#_>=1) { $a=$_[1]; $pattern=qr/$_[0]/}
|
|
else {$a=$_[0]; $pattern=qr/\s+/};
|
if ($#_>=1) { $a=$_[1]; $pattern=qr/$_[0]/} |
do
|
else {$a=$_[0]; $pattern=qr/\s+/}; |
{
|
do |
$b=<$a>;
|
{ |
$b =~ s/^\s+//g;
|
$b=<$a>; |
$b =~ s/\s+$//g;
|
$b =~ s/^\s+//g; |
$b =~ s/\#.*$//g;
|
$b =~ s/\s+$//g; |
}
|
$b =~ s/\#.*$//g; |
until (($b ne '')||eof($a));
|
} |
|
until (($b ne '')||eof($a)); |
|
|
$b ? split(/$pattern/, $b):undef;
|
|
}
|
$b ? split(/$pattern/, $b):undef; |
|
} |
sub config_error()
|
|
{
|
sub config_error() |
"Can not open $_[0] file ${$_[0]}. Check your config.pl";
|
{ |
}
|
"Can not open $_[0] file ${$_[0]}. Check your config.pl"; |
|
} |
|
|
|
|
sub input_files
|
|
{
|
sub input_files |
foreach $file (@_)
|
{ |
{
|
foreach $file (@_) |
my $f=lc $file;
|
{ |
open($file, "<$$f") or die "Can not open $file file $$f. Check your chgk.cnf\n";
|
my $f=lc $file; |
}
|
open($file, "<$$f") or die "Can not open $file file $$f. Check your chgk.cnf\n"; |
}
|
} |
|
} |
sub output_files
|
|
{
|
sub output_files |
foreach $file (@_)
|
{ |
{
|
foreach $file (@_) |
my $f=lc $file;
|
{ |
open($file, ">$$f") or die "Can not open $file file $$f. Check your chgk.cnf\n";
|
my $f=lc $file; |
}
|
open($file, ">$$f") or die "Can not open $file file $$f. Check your chgk.cnf\n"; |
}
|
} |
|
} |
format WORDLIST =
|
|
@####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
|
format WORDLIST = |
$prt{c}, $prt{word}
|
@####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
.
|
$prt{c}, $prt{word} |
|
. |
|
|
format DWORDLIST =
|
|
@####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
|
format DWORDLIST = |
$prt{c}, $prt{word}
|
@####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
.
|
$prt{c}, $prt{word} |
|
. |
format VWORDLIST =
|
|
@####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
|
format VWORDLIST = |
$prt{c}, $prt{word}
|
@####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
.
|
$prt{c}, $prt{word} |
|
. |
|
|
format EWORDLIST =
|
|
@####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
|
format EWORDLIST = |
$prt{c}, $prt{word}
|
@####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
.
|
$prt{c}, $prt{word} |
|
. |
format KWORDLIST =
|
|
@####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
|
format KWORDLIST = |
$prt{c}, $prt{word}
|
@####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
.
|
$prt{c}, $prt{word} |
|
. |
|
|
|
|
format TABLE =
|
|
@<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
|
format TABLE = |
$prt{word}, $prt{nf}, $prt{flag}
|
@<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
.
|
$prt{word}, $prt{nf}, $prt{flag} |
|
. |
format NEWTABLE =
|
|
@<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
|
format NEWTABLE = |
$prt{word}, $prt{nf}
|
@<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
.
|
$prt{word}, $prt{nf} |
|
. |
|
|
|
|
format NF =
|
|
@####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
|
format NF = |
$prt{c}, $prt{word}, $prt{flag}
|
@####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
.
|
$prt{c}, $prt{word}, $prt{flag} |
|
. |
format NEWNF =
|
|
@####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
|
format NEWNF = |
$prt{c}, $prt{word}
|
@####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
.
|
$prt{c}, $prt{word} |
|
. |
|
|
format ERRORS =
|
|
@####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
|
format ERRORS = |
$prt{c}, $prt{word}
|
@####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
.
|
$prt{c}, $prt{word} |
|
. |
format NEWERRORS =
|
|
@####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
|
format NEWERRORS = |
$prt{c}, $prt{word}
|
@####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<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<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
|
format IN2OUT = |
$prt{in}, $prt{out}
|
@<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
.
|
$prt{in}, $prt{out} |
|
. |
format CTABLE =
|
|
@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
|
format CTABLE = |
$prt{word}, $prt{number}
|
@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
.
|
$prt{word}, $prt{number} |
|
. |
format CNF =
|
|
@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
|
format CNF = |
$prt{kvo}
|
@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
.
|
$prt{kvo} |
|
. |
format ALIKE =
|
|
^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< | ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
|
format ALIKE = |
$prt{first}, $prt{second}
|
^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< | ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< | ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~~
|
$prt{first}, $prt{second} |
$prt{first}, $prt{second}
|
^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< | ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~~ |
.
|
$prt{first}, $prt{second} |
|
. |
|
|
1;
|
|
|
1; |
__END__
|
|
|
__END__ |