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

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

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


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