Diff for /db/prgsrc/chgkfiles.pm between versions 1.1 and 1.5

version 1.1, 2001/10/31 03:00:07 version 1.5, 2001/11/19 01:13:41
Line 1 Line 1
 package chgkfiles;  #!/usr/bin/perl
 use DBI;  
 use Exporter;  =head1 NAME
 use vars qw(@ISA @EXPORT);  
 @ISA=qw(Exporter);  chgkfiles.pm
   
 @EXPORT = qw(&input_files &output_files &mywrite &auto_message  =head1 SYNOPSIS
             &myprint &config_error &getstring);  
     use chgkfiles.pm  
   
 BEGIN {do "chgk.cnf"};  =head1 DESCRIPTION
   
 my %prt;    òÁÂÏÔÁ Ó ÆÁÊÌÁÍÉ
   
 sub auto_message  =head1 AUTHOR
 {  
   my $time=localtime;  òÏÍÁÎ óÅÍÉÚÁÒÏ×
   my $f=$_[0];  
   =cut
   print $f "# This file is automatically generated at $time by $_[1]\n";  
 }  package chgkfiles;
   use DBI;
 sub mywrite  use Exporter;
 {  use vars qw(@ISA @EXPORT);
   (my $file, %prt)=@_;  @ISA=qw(Exporter);
   write $file;  
 }  @EXPORT = qw(&input_files &output_files &mywrite &auto_message 
               &myprint &config_error &getstring);
 sub myprint  
 {  
   (my $file, @prt)=@_;  BEGIN {do "chgk.cnf"};
   print $file @prt;  
 }  my %prt;
   
 sub setcount  sub auto_message
 {  {
   $c=shift    my $time=localtime;
 }    my $f=$_[0];
   
 sub setword    print $f "# This file is automatically generated at $time by $_[1]\n";
 {  }
   $word=shift  
 }  sub mywrite
   {
     (my $file, %prt)=@_;
 sub getstring #áåð¸ò ïåðâóþ    write $file;
 {  }
   
    if ($#_>=1) { $a=$_[1]; $pattern=qr/$_[0]/}  sub myprint
    else {$a=$_[0]; $pattern=qr/\s+/};  {
    do    (my $file, @prt)=@_;
    {      print $file @prt;
      $b=<$a>;  }
      $b =~ s/^\s+//g;  
      $b =~ s/\s+$//g;  sub setcount
      $b =~ s/\#.*$//g;  {
    }    $c=shift
    until (($b ne '')||eof($a));  }
   
   sub setword
   $b ? split(/$pattern/, $b):undef;  {
 }    $word=shift
   }
 sub config_error()  
 {  
   "Can not open $_[0] file ${$_[0]}. Check your config.pl";  sub getstring #áåð¸ò ïåðâóþ
 }  {
   
      if ($#_>=1) { $a=$_[1]; $pattern=qr/$_[0]/}
      else {$a=$_[0]; $pattern=qr/\s+/};
 sub input_files     do
 {     {   
     foreach $file (@_)       $b=<$a>;
     {       $b =~ s/^\s+//g;
           my $f=lc $file;       $b =~ s/\s+$//g;
           open($file, "<$$f") or die "Can not open $file file $$f. Check your chgk.cnf\n";       $b =~ s/\#.*$//g;
     }     }
 }     until (($b ne '')||eof($a));
   
 sub output_files  
 {    $b ? split(/$pattern/, $b):undef;
     foreach $file (@_)  }
     {  
           my $f=lc $file;  sub config_error()
           open($file, ">$$f") or die "Can not open $file file $$f. Check your chgk.cnf\n";  {
     }    "Can not open $_[0] file ${$_[0]}. Check your config.pl";
 }  }
   
 format WORDLIST =  
 @####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  
 $prt{c}, $prt{word}  sub input_files
 .  {
       foreach $file (@_) 
              {
 format DWORDLIST =            my $f=lc $file;
 @####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<            open($file, "<$$f") or die "Can not open $file file $$f. Check your chgk.cnf\n";
 $prt{c}, $prt{word}      }
 .  }
   
 format VWORDLIST =  sub output_files
 @####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  {
 $prt{c}, $prt{word}      foreach $file (@_) 
 .      {
             my $f=lc $file;
             open($file, ">$$f") or die "Can not open $file file $$f. Check your chgk.cnf\n";
 format EWORDLIST =      }
 @####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  }
 $prt{c}, $prt{word}  
 .  format WORDLIST =
   @####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 format KWORDLIST =  $prt{c}, $prt{word}
 @####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  .
 $prt{c}, $prt{word}  
 .          
   format DWORDLIST =
   @####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
   $prt{c}, $prt{word}
 format TABLE =  .
 @<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  
 $prt{word}, $prt{nf}, $prt{flag}  format VWORDLIST =
 .  @####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
   $prt{c}, $prt{word}
 format NEWTABLE =  .
 @<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  
 $prt{word}, $prt{nf}  
 .  format EWORDLIST =
   @####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
   $prt{c}, $prt{word}
   .
 format NF =  
 @####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  format KWORDLIST =
 $prt{c}, $prt{word}, $prt{flag}  @####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 .  $prt{c}, $prt{word}
   .
 format NEWNF =  
 @####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  
 $prt{c}, $prt{word}  
 .  format TABLE =
   @<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
   $prt{word}, $prt{nf}, $prt{flag}
 format ERRORS =  .
 @####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  
 $prt{c}, $prt{word}  format NEWTABLE =
 .  @<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
   $prt{word}, $prt{nf}
 format NEWERRORS =  .
 @####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  
 $prt{c}, $prt{word}  
 .  
   format NF =
 format VERSIONS =  @####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  $prt{c}, $prt{word}, $prt{flag}
 $prt{c}, $prt{word}, $prt{k}  .
 .  
   format NEWNF =
 format EQUALS =  @####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  $prt{c}, $prt{word}
 $prt{first}, $prt{second}  .
 .  
   
 format IN2OUT =  format ERRORS =
 @<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  @####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 $prt{in}, $prt{out}  $prt{c}, $prt{word}
 .  .
   
 format CTABLE =  format NEWERRORS =
 @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  @####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 $prt{word}, $prt{number}  $prt{c}, $prt{word}
 .  .
   
 format CNF =  format VERSIONS =
 @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 $prt{kvo}  $prt{c}, $prt{word}, $prt{k}
 .  .
   
 format ALIKE  =  format EQUALS =
 ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< | ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 $prt{first}, $prt{second}  $prt{first}, $prt{second}
 ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< | ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~~  .
 $prt{first}, $prt{second}  
 .  format IN2OUT =
   @<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
   $prt{in}, $prt{out}
 1;  .
   
 __END__  format CTABLE =
   @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
   $prt{word}, $prt{number}
   .
   
   format CNF =
   @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
   $prt{kvo}
   .
   
   format ALIKE  =
   ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< | ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
   $prt{first}, $prt{second}
   ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< | ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~~
   $prt{first}, $prt{second}
   .
   
   
   1;
   
   __END__

Removed from v.1.1  
changed lines
  Added in v.1.5


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>