package chgkfiles;
use DBI;
use Exporter;
use VARS qw(@ISA @EXPORT);
@ISA=qw(Exporter);
@EXPORT = qw(&input_files &output_files &mywrite &auto_message
&myprint &config_error &getstring);
BEGIN {do "chgk.cnf"};
my %prt;
sub auto_message
{
my $time=localtime;
my $f=$_[0];
print $f "# This file is automatically generated at $time by $_[1]\n";
}
sub mywrite
{
(my $file, %prt)=@_;
write $file;
}
sub myprint
{
(my $file, @prt)=@_;
print $file @prt;
}
sub setcount
{
$c=shift
}
sub setword
{
$word=shift
}
sub getstring #берёт первую
{
if ($#_>=1) { $a=$_[1]; $pattern=qr/$_[0]/}
else {$a=$_[0]; $pattern=qr/\s+/};
do
{
$b=<$a>;
$b =~ s/^\s+//g;
$b =~ s/\s+$//g;
$b =~ s/\#.*$//g;
}
until ($b||eof($a));
$b ? split(/$pattern/, $b):0;
}
sub config_error()
{
"Can not open $_[0] file ${$_[0]}. Check your config.pl";
}
sub input_files
{
foreach $file (@_)
{
my $f=lc $file;
open($file, "<$$f") or die "Can not open $file file $$f. Check your chgk.cnf\n";
}
}
sub output_files
{
foreach $file (@_)
{
my $f=lc $file;
open($file, ">$$f") or die "Can not open $file file $$f. Check your chgk.cnf\n";
}
}
format WORDLIST =
@####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$prt{c}, $prt{word}
.
format DWORDLIST =
@####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$prt{c}, $prt{word}
.
format VWORDLIST =
@####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$prt{c}, $prt{word}
.
format EWORDLIST =
@####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$prt{c}, $prt{word}
.
format KWORDLIST =
@####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$prt{c}, $prt{word}
.
format TABLE =
@<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$prt{word}, $prt{nf}
.
format NEWTABLE =
@<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$prt{word}, $prt{nf}
.
format NF =
@####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$prt{c}, $prt{word}
.
format NEWNF =
@####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$prt{c}, $prt{word}
.
format ERRORS =
@####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$prt{c}, $prt{word}
.
format NEWERRORS =
@####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$prt{c}, $prt{word}
.
format VERSIONS =
@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$prt{c}, $prt{word}, $prt{k}
.
format EQUALS =
@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$prt{first}, $prt{second}
.
format CTABLE =
@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$prt{word}, $prt{number}
.
format CNF =
@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$prt{kvo}
.
format ALIKE =
^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< | ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$prt{first}, $prt{second}
^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< | ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~~
$prt{first}, $prt{second}
.
1;
__END__
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>